]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap_r/thr_posix.c
Add valx arg to config_parse_add - indicate which value in the current
[openldap] / libraries / libldap_r / thr_posix.c
index a80f69f8e5782b4dd45f41cb060d7d0b2c56f627..ce48b32b53000e919b28449f138745bb055e6422 100644 (file)
 
 #include <ac/errno.h>
 
-#if defined( HAVE_YIELDING_SELECT )
+#ifdef REPLACE_BROKEN_YIELD
+#ifndef HAVE_NANOSLEEP
 #include <ac/socket.h>
+#endif
 #include <ac/time.h>
 #endif
 
@@ -212,12 +214,18 @@ ldap_pvt_thread_kill( ldap_pvt_thread_t thread, int signo )
 int 
 ldap_pvt_thread_yield( void )
 {
-#if HAVE_YIELDING_SELECT
+#ifdef REPLACE_BROKEN_YIELD
+#ifdef HAVE_NANOSLEEP
+       struct timespec t = { 0, 0 };
+       nanosleep(&t, NULL);
+#else
        struct timeval tv = {0,0};
        select( 0, NULL, NULL, NULL, &tv );
+#endif
        return 0;
 #elif HAVE_THR_YIELD
-       return thr_yield();
+       thr_yield();
+       return 0;
 
 #elif HAVE_PTHREADS == 10
        return sched_yield();