OpenLDAP 2.3 Change Log
OpenLDAP 2.3.16 Engineering
+ Build environment
+ Replace sched_yield(2) on Linux with select(2) (ITS#3950)
OpenLDAP 2.3.15 Release
Fixed slapd strerror logging bug (ITS#4292)
#! /bin/sh
-# From configure.in OpenLDAP: pkg/ldap/configure.in,v 1.560.2.18 2005/11/26 17:01:54 kurt Exp .
+# From configure.in OpenLDAP: pkg/ldap/configure.in,v 1.560.2.20 2006/01/03 22:16:00 kurt Exp .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.59.
#
{ { echo "$as_me:$LINENO: error: pthread_create is not usable, check environment settings" >&5
echo "$as_me: error: pthread_create is not usable, check environment settings" >&2;}
{ (exit 1); exit 1; }; }
+ fi
+
+ ol_replace_broken_yield=no
+ case "$target" in
+ *-*-linux*)
+ ol_replace_broken_yield=yes
+ ;;
+ esac
+
+ if test $ol_replace_broken_yield = yes ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define REPLACE_BROKEN_YIELD 1
+_ACEOF
+
fi
if test $ol_with_yielding_select = auto ; then
-
for ac_func in \
strtoll \
strspn \
sysconf \
- usleep \
waitpid \
wait4 \
write \
AC_MSG_ERROR([pthread_create is not usable, check environment settings])
fi
+ ol_replace_broken_yield=no
+ case "$target" in
+ *-*-linux*)
+ ol_replace_broken_yield=yes
+ ;;
+ esac
+
+ if test $ol_replace_broken_yield = yes ; then
+ AC_DEFINE([REPLACE_BROKEN_YIELD],1,
+ [define if sched_yield yields the entire process])
+ fi
+
dnl Check if select causes an yield
if test $ol_with_yielding_select = auto ; then
AC_CACHE_CHECK([if select yields when using pthreads],
strtoll \
strspn \
sysconf \
- usleep \
waitpid \
wait4 \
write \
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
-/* Define to 1 if you have the `usleep' function. */
-#undef HAVE_USLEEP
-
/* Define to 1 if you have the <utime.h> header file. */
#undef HAVE_UTIME_H
/* Define to the version of this package. */
#undef PACKAGE_VERSION
+/* define if sched_yield yields the entire process */
+#undef REPLACE_BROKEN_YIELD
+
/* Define as the return type of signal handlers (`int' or `void'). */
#undef RETSIGTYPE
#include <ac/errno.h>
+#ifdef REPLACE_BROKEN_YIELD
+#ifndef HAVE_NANOSLEEP
+#include <ac/socket.h>
+#endif
+#include <ac/time.h>
+#endif
+
#include "ldap_pvt_thread.h" /* Get the thread interface */
#define LDAP_THREAD_IMPLEMENTATION
#define LDAP_THREAD_RDWR_IMPLEMENTATION
int
ldap_pvt_thread_yield( void )
{
-#if HAVE_THR_YIELD
+#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();
#elif HAVE_PTHREADS == 10