mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-30 13:30:57 +08:00
ITS#3950 use select instead of yield when select does the right thing.
This commit is contained in:
parent
a53fc12578
commit
69179a5c44
@ -20,6 +20,11 @@
|
||||
|
||||
#include <ac/errno.h>
|
||||
|
||||
#if defined( HAVE_YIELDING_SELECT )
|
||||
#include <ac/socket.h>
|
||||
#include <ac/time.h>
|
||||
#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
|
||||
|
Loading…
Reference in New Issue
Block a user