From: Kurt Zeilenga Date: Sun, 6 May 2001 18:58:45 +0000 (+0000) Subject: NT thread fix X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~1439 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=325a12e25d02b073ab8028fa8b4df6014d0edb7c;p=openldap NT thread fix --- diff --git a/libraries/libldap_r/thr_nt.c b/libraries/libldap_r/thr_nt.c index 620da6b642..0f774e5629 100644 --- a/libraries/libldap_r/thr_nt.c +++ b/libraries/libldap_r/thr_nt.c @@ -35,9 +35,16 @@ ldap_pvt_thread_create( ldap_pvt_thread_t * thread, void *(*start_routine)( void *), void *arg) { - *thread = (ldap_pvt_thread_t)_beginthread( (void *) start_routine, - 0, arg ); - return ( (unsigned long)*thread == -1 ? -1 : 0 ); + unsigned long tid + HANDLE thd; + + thd = _beginthreadex( NULL, 0, + (LPTHREAD_START_ROUTINE) start_routine, arg, + 0, &tid ); + + *thread = (ldap_pvt_thread_t) thd; + + return thd == NULL ? -1 : 0; } void