Commit 04d91569 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Replaced PREEMPTIVE_THREADS with HAVE_YIELDING_SELECT to clarify

the exact nature of the functionality being tested.  -DNO_THREADS
does NOT have a yield select, hence the macro is not defined.
The slapd/daemon code has been changed to test both no threads
and yielding select before using a timeout of NULL.
parent 1eba97fc
......@@ -69,9 +69,6 @@
/* define if you have PP */
#undef HAVE_PP
/* define if you have a preemptive POSIX Threads implementation */
#undef HAVE_PREEMPTIVE_PTHREADS
/* define if you have POSIX Threads */
#undef HAVE_PTHREADS
......@@ -105,6 +102,9 @@
/* define if you have XTPP */
#undef HAVE_XTPP
/* define this if select() implicitly yields in thread environments */
#undef HAVE_YIELDING_SELECT
/* define this for connectionless LDAP support */
#undef LDAP_CONNECTIONLESS
......@@ -147,9 +147,6 @@
/* define this if you want no thread support */
#undef NO_THREADS
/* define this if the thread package is preemptive */
#undef PREEMPTIVE_THREADS
/* define this for ACL Group support */
#undef SLAPD_ACLGROUPS
......
This diff is collapsed.
......@@ -42,7 +42,7 @@ OL_ARG_WITH(kerberos,[ --with-kerberos use Kerberos],
auto, [auto k5 k4 afs yes no])
OL_ARG_WITH(threads,[ --with-threads use threads],
auto, [auto posix mach lwp yes no manual] )
OL_ARG_WITH(preemptive,[ --with-preemptive thread implementation is preemptive],
OL_ARG_WITH(yielding_select,[ --with-yielding-select with implicitly yielding select],
auto, [auto yes no manual] )
dnl Server options
......@@ -415,8 +415,8 @@ if test $ol_with_threads = auto -o $ol_with_threads = posix ; then
AC_CHECK_LIB(pthread, pthread_join, [
ol_link_threads=posix
LTHREAD_LIBS="$LTHREAD_LIBS -lpthread -lexc"
if test $ol_with_preemptive = auto ; then
ol_with_preemptive=yes
if test $ol_with_yielding_select = auto ; then
ol_with_yielding_select=yes
fi
],,[-lexc])
LIBS="$save_LIBS"
......@@ -428,8 +428,8 @@ if test $ol_with_threads = auto -o $ol_with_threads = posix ; then
AC_CHECK_LIB(pthreads, pthread_join, [
ol_link_threads=posix
LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads -lmach -lexc -lc_r"
if test $ol_with_preemptive = auto ; then
ol_with_preemptive=yes
if test $ol_with_yielding_select = auto ; then
ol_with_yielding_select=yes
fi
],,[-lmach -lexc -lc_r])
LIBS="$save_LIBS"
......@@ -504,9 +504,9 @@ if test $ol_with_threads = auto -o $ol_with_threads = posix ; then
thr_setconcurrency \
)
dnl Check PREEMPTIVE Implementation
if test $ol_with_preemptive = auto ; then
AC_MSG_CHECKING([for preemptive Pthread implementation])
dnl Check if select causes an yield
if test $ol_with_yielding_select = auto ; then
AC_MSG_CHECKING([if select yields])
AC_TRY_RUN([
#include <sys/types.h>
#include <sys/time.h>
......@@ -560,13 +560,12 @@ int argc; char **argv;
#endif
exit(0);
}
], [ol_pthread_preemptive=yes], [ol_pthread_preemptive=no], [
AC_MSG_ERROR([crossing compiling: use --with-preemptive=yes|no|manual])])
AC_MSG_RESULT($ol_pthread_preemptive)
], [ol_pthread_select_yields=yes], [ol_pthread_select_yields=no], [
AC_MSG_ERROR([crossing compiling: use --with-yielding_select=yes|no|manual])])
AC_MSG_RESULT($ol_pthread_select_yields)
if test $ol_pthread_preemptive = yes ; then
AC_DEFINE(HAVE_PREEMPTIVE_PTHREADS)
ol_with_preemptive=yes
if test $ol_pthread_select_yields = yes ; then
ol_with_yielding_select=yes
fi
fi
......@@ -648,8 +647,8 @@ if test $ol_with_threads = auto -o $ol_with_threads = lwp ; then
LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
ol_link_threads=thr
if test $ol_with_preemptive = auto ; then
ol_with_preemptive=yes
if test $ol_with_yielding_select = auto ; then
ol_with_yielding_select=yes
fi
fi
fi
......@@ -664,15 +663,15 @@ if test $ol_with_threads = auto -o $ol_with_threads = lwp ; then
LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
ol_link_threads=lwp
if test $ol_with_preemptive = auto ; then
ol_with_preemptive=no
if test $ol_with_yielding_select = auto ; then
ol_with_yielding_select=no
fi
fi
fi
fi
if test $ol_with_preemptive = yes ; then
AC_DEFINE(PREEMPTIVE_THREADS,1)
if test $ol_with_yielding_select = yes ; then
AC_DEFINE(HAVE_YIELDING_SELECT,1)
fi
if test $ol_with_threads = manual ; then
......@@ -731,7 +730,6 @@ if test $ol_link_threads = no ; then
fi
AC_DEFINE(NO_THREADS,1)
AC_DEFINE(PREEMPTIVE_THREADS,1)
LTHREAD_LIBS=""
fi
......
......@@ -200,11 +200,6 @@ LDAP_BEGIN_DECL
#define NO_THREADS 1
#endif
#ifndef PREEMPTIVE_THREADS
/* treat no threads as preemptive */
#define PREEMPTIVE_THREADS 1
#endif
typedef void *(*VFP)();
/* thread attributes and thread type */
......
......@@ -189,7 +189,7 @@ slapd_daemon(
Debug( LDAP_DEBUG_CONNS, "before select active_threads %d\n",
active_threads, 0, 0 );
#ifdef PREEMPTIVE_THREADS
#if defined( HAVE_YIELDING_SELECT ) || defined( NO_THREADS )
tvp = NULL;
#else
tvp = active_threads ? &zero : NULL;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment