]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap_r/thr_posix.c
Use 'long' for LBER_INT_T.
[openldap] / libraries / libldap_r / thr_posix.c
index 96c5e8be99874b747d68902249d1cccf0aa710ae..c44bee48c315ff463008ef9177c3b2b500db6dc7 100644 (file)
@@ -1,3 +1,4 @@
+/* $OpenLDAP$ */
 /*
  * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA
  * All rights reserved.
 
 #include "portable.h"
 
+#if defined( HAVE_PTHREADS )
+
 #include <ac/errno.h>
 
 #include "ldap_pvt_thread.h"
 
-#if defined( HAVE_PTHREADS )
 
 #if HAVE_PTHREADS_D4
 #  define LDAP_PVT_THREAD_ATTR_DEFAULT         pthread_attr_default
@@ -39,6 +41,12 @@ ldap_pvt_thread_initialize( void )
        return 0;
 }
 
+int
+ldap_pvt_thread_destroy( void )
+{
+       return 0;
+}
+
 #ifdef HAVE_PTHREAD_SETCONCURRENCY
 int
 ldap_pvt_thread_set_concurrency(int n)
@@ -119,13 +127,20 @@ ldap_pvt_thread_kill( ldap_pvt_thread_t thread, int signo )
 int 
 ldap_pvt_thread_yield( void )
 {
-#ifdef HAVE_SCHED_YIELD
+#ifdef _POSIX_THREAD_IS_GNU_PTH
+       sched_yield();
+       return 0;
+
+#elif HAVE_SCHED_YIELD
        return sched_yield();
+
 #elif HAVE_PTHREAD_YIELD
        pthread_yield();
        return 0;
+
 #elif HAVE_THR_YIELD
        return thr_yield();
+
 #else
        return 0;
 #endif