| 64 | static void thread_util_donework_int(struct thread_info *info); |
| 65 | |
| 66 | void 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 | |
| 90 | void thread_add_resource(int type, void *resource) |
| 91 | { |
no test coverage detected