X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=compat%2Fwin32%2Fpthread.c;h=010e875ec4dd8d7154a0911661570165ac1ae874;hb=e1165dd1442017c2b2722027168c497640f25746;hp=0f949fc4250b5de4a3545931506fc48373ad8c6b;hpb=49559cad6cab8af548321249d320d9bb372d1859;p=git.git diff --git a/compat/win32/pthread.c b/compat/win32/pthread.c index 0f949fc42..010e875ec 100644 --- a/compat/win32/pthread.c +++ b/compat/win32/pthread.c @@ -16,6 +16,7 @@ static unsigned __stdcall win32_start_routine(void *arg) { pthread_t *thread = arg; + thread->tid = GetCurrentThreadId(); thread->arg = thread->start_routine(thread->arg); return 0; } @@ -49,6 +50,13 @@ int win32_pthread_join(pthread_t *thread, void **value_ptr) } } +pthread_t pthread_self(void) +{ + pthread_t t = { 0 }; + t.tid = GetCurrentThreadId(); + return t; +} + int pthread_cond_init(pthread_cond_t *cond, const void *unused) { cond->waiters = 0;