summaryrefslogtreecommitdiff
path: root/compat/win32/pthread.c
diff options
context:
space:
mode:
Diffstat (limited to 'compat/win32/pthread.c')
-rw-r--r--compat/win32/pthread.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/compat/win32/pthread.c b/compat/win32/pthread.c
index 0f949fc..010e875 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;