diff --git a/src/thread.c b/src/thread.c index 391ba15..394cf78 100644 --- a/src/thread.c +++ b/src/thread.c @@ -1666,7 +1666,7 @@ pthread_create (pthread_t *th, const pthread_attr_t *attr, void *(* func)(void * /* Make sure tv->h has value of INVALID_HANDLE_VALUE */ _ReadWriteBarrier(); - thrd = (HANDLE) _beginthreadex(NULL, ssize, pthread_create_wrapper, tv, 0x4/*CREATE_SUSPEND*/, NULL); + thrd = (HANDLE) _beginthreadex(NULL, ssize, pthread_create_wrapper, tv, 0x4/*CREATE_SUSPEND*/, (unsigned int*)&tv->tid); if (thrd == INVALID_HANDLE_VALUE) thrd = 0; /* Failed */