From: Howard Chu Date: Fri, 6 Jan 2006 01:02:00 +0000 (+0000) Subject: ITS#3950 use select instead of yield when select does the right thing. X-Git-Tag: OPENLDAP_REL_ENG_2_4_BP~456 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=69179a5c447ec2faeb03a648c6a9b3b287a42d90;p=openldap ITS#3950 use select instead of yield when select does the right thing. --- 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