]> git.sur5r.net Git - openldap/commitdiff
NT thread fix
authorKurt Zeilenga <kurt@openldap.org>
Sun, 6 May 2001 18:58:45 +0000 (18:58 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Sun, 6 May 2001 18:58:45 +0000 (18:58 +0000)
libraries/libldap_r/thr_nt.c

index 620da6b642ab8786fd21796dc2994194d5c1b95c..0f774e5629e0cccdcfcb6a453ea4829ea8cf19bd 100644 (file)
@@ -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