| 70 | } |
| 71 | |
| 72 | static int pthread_create_hook(pthread_t* thread, const pthread_attr_t* attr, ThreadFunc start_routine, void* arg) { |
| 73 | ThreadEntry* entry = (ThreadEntry*) malloc(sizeof(ThreadEntry)); |
| 74 | entry->start_routine = start_routine; |
| 75 | entry->arg = arg; |
| 76 | |
| 77 | int result = _orig_pthread_create(thread, attr, thread_start_wrapper, entry); |
| 78 | if (result != 0) { |
| 79 | free(entry); |
| 80 | } |
| 81 | return result; |
| 82 | } |
| 83 | |
| 84 | static void pthread_exit_hook(void* retval) { |
| 85 | Log::debug("thread_exit: 0x%lx", (unsigned long)(uintptr_t)pthread_self()); |
no test coverage detected