MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / thread_started

Function thread_started

util/thread_util.c:66–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64static void thread_util_donework_int(struct thread_info *info);
65
66void thread_started(char *name)
67{
68 struct thread_info *info;
69
70 info = pthread_getspecific(thread_util_key);
71 if (info) {
72 fprintf(stderr, "thread_started called twice\n");
73 cheap_stack_trace();
74 return;
75 }
76
77 info = malloc(sizeof(struct thread_info));
78 info->tid = pthread_self();
79 info->archtid = getarchtid();
80 Pthread_setspecific(thread_util_key, info);
81 listc_init(&info->resource_list, offsetof(struct thread_resource, lnk));
82 info->resource_hash =
83 hash_init_o(offsetof(struct thread_resource, resource), sizeof(void *));
84 info->name = strdup(name);
85 if (thread_debug)
86 printf("thd: started %s tid %p archtid %" PRIxPTR "0x%p\n", name,
87 (void *)info->tid, (intptr_t) info->archtid, info);
88}
89
90void thread_add_resource(int type, void *resource)
91{

Callers 15

bdb_thread_wrapperFunction · 0.85
elect_threadFunction · 0.85
dummy_add_thread_intFunction · 0.85
rep_catchup_add_threadFunction · 0.85
hostdown_threadFunction · 0.85
watcher_threadFunction · 0.85
memp_trickle_threadFunction · 0.85
deadlockdetect_threadFunction · 0.85
master_lease_threadFunction · 0.85
coherency_lease_threadFunction · 0.85
logdelete_threadFunction · 0.85

Calls 5

mallocFunction · 0.85
getarchtidFunction · 0.85
listc_initFunction · 0.85
hash_init_oFunction · 0.85
strdupFunction · 0.50

Tested by

no test coverage detected