]> git.sur5r.net Git - openldap/blobdiff - libraries/liblthread/thread.c
FreeBSD2 has POSIX_THREADS but is missing sched_yield()
[openldap] / libraries / liblthread / thread.c
index 12574d0606d50eb5b80f119bac649d904ec739b8..d0a62d5a815e0c8ae15a51edc13eb9d82f81fb32 100644 (file)
@@ -491,14 +491,17 @@ pthread_kill( pthread_t tid, int sig )
 
 #if defined ( POSIX_THREADS )
 
-#ifndef SCHED_YIELD_MISSING
+#ifdef HAVE_SCHED_YIELD
+#ifdef HAVE_SCHED_H
 #include <sched.h>
+#endif /* HAVE_SCHED_H */
 
+/* POSIX Threads (final) does have a pthread_yield function */
 void pthread_yield( void )
 {
        sched_yield();
 }
-#endif
+#endif /* HAVE_SCHED_YIELD */
 
 #endif /* posix threads */
 #endif /* dce pthreads */