From 69179a5c447ec2faeb03a648c6a9b3b287a42d90 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Fri, 6 Jan 2006 01:02:00 +0000 Subject: [PATCH] ITS#3950 use select instead of yield when select does the right thing. --- libraries/libldap_r/thr_posix.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/libraries/libldap_r/thr_posix.c b/libraries/libldap_r/thr_posix.c index 2a05236399..a80f69f8e5 100644 --- a/libraries/libldap_r/thr_posix.c +++ b/libraries/libldap_r/thr_posix.c @@ -20,6 +20,11 @@ #include +#if defined( HAVE_YIELDING_SELECT ) +#include +#include +#endif + #include "ldap_pvt_thread.h" /* Get the thread interface */ #define LDAP_THREAD_IMPLEMENTATION #define LDAP_THREAD_RDWR_IMPLEMENTATION @@ -207,7 +212,11 @@ ldap_pvt_thread_kill( ldap_pvt_thread_t thread, int signo ) int ldap_pvt_thread_yield( void ) { -#if HAVE_THR_YIELD +#if HAVE_YIELDING_SELECT + struct timeval tv = {0,0}; + select( 0, NULL, NULL, NULL, &tv ); + return 0; +#elif HAVE_THR_YIELD return thr_yield(); #elif HAVE_PTHREADS == 10 -- 2.39.5