dnl #if defined( HAVE_REENTRANT_FUNCTIONS ) || defined( HAVE_FUNC_R )
dnl func_r(...);
dnl #else
-dnl # if defined( HAVE_THREADS )
-dnl /* lock */
-dnl # endif
-dnl func(...);
-dnl # if defined( HAVE_THREADS )
-dnl /* unlock */
-dnl # endif
+dnl /* lock */
+dnl func(...);
+dnl /* unlock */
dnl #endif
dnl
dnl HAVE_REENTRANT_FUNCTIONS is derived from:
dnl
dnl and is currently defined in <ldap_pvt_thread.h>
dnl
-dnl HAVE_THREADS is defined by <ldap_pvt_thread.h> iff -UNO_THREADS
-dnl
dnl libldap/*.c should only include <ldap_pvt_thread.h> iff
dnl LDAP_R_COMPILE is defined. ie:
dnl #ifdef LDAP_R_COMPILE
fi
if test $ol_link_threads = no ; then
+ if test $ol_enable_slapd != no; then
+ AC_MSG_ERROR([slapd requires thread support])
+ fi
+
if test $ol_with_threads = yes ; then
AC_MSG_ERROR([no suitable thread support])
fi
#include <ldap_rq.h>
-#ifndef NO_THREADS
typedef enum {
MT_UNKNOWN,
MT_RUNQUEUE,
Operation *op,
SlapReply *rs,
Entry *e );
-#endif /* ! NO_THREADS */
/*
* initializes log subentry
BackendDB *be,
monitor_subsys_t *ms )
{
-#ifndef NO_THREADS
monitor_info_t *mi;
monitor_entry_t *mp;
Entry *e, **ep, *e_thread;
monitor_cache_release( mi, e_thread );
-#endif /* ! NO_THREADS */
return( 0 );
}
-#ifndef NO_THREADS
static int
monitor_subsys_thread_update(
Operation *op,
return SLAP_CB_CONTINUE;
}
-#endif /* ! NO_THREADS */
"EQUALITY caseIgnoreMatch "
"SYNTAX OMsDirectoryString X-ORDERED 'VALUES' )", NULL, NULL },
{ "listener-threads", "count", 2, 0, 0,
-#ifdef NO_THREADS
- ARG_IGNORED, NULL,
-#else
ARG_UINT|ARG_MAGIC|CFG_LTHREADS, &config_generic,
-#endif
"( OLcfgGlAt:93 NAME 'olcListenerThreads' "
"EQUALITY integerMatch "
"SYNTAX OMsInteger SINGLE-VALUE )", NULL, NULL },
"DESC 'Custom TCP buffer size' "
"SYNTAX OMsDirectoryString )", NULL, NULL },
{ "threads", "count", 2, 2, 0,
-#ifdef NO_THREADS
- ARG_IGNORED, NULL,
-#else
ARG_INT|ARG_MAGIC|CFG_THREADS, &config_generic,
-#endif
"( OLcfgGlAt:66 NAME 'olcThreads' "
"EQUALITY integerMatch "
"SYNTAX OMsInteger SINGLE-VALUE )", NULL, NULL },
{ "threadqueues", "count", 2, 2, 0,
-#ifdef NO_THREADS
- ARG_IGNORED, NULL,
-#else
ARG_INT|ARG_MAGIC|CFG_THREADQS, &config_generic,
-#endif
"( OLcfgGlAt:95 NAME 'olcThreadQueues' "
"EQUALITY integerMatch "
"SYNTAX OMsInteger SINGLE-VALUE )", NULL, NULL },
}
}
-#ifdef NO_THREADS
- if ( conn->c_struct_state != SLAP_C_USED ) {
- /* connection must have got closed underneath us */
- return 1;
- }
-#endif
-
assert( conn->c_struct_state == SLAP_C_USED );
return rc;
}
static int emfile;
static volatile int waking;
-#ifdef NO_THREADS
-#define WAKE_LISTENER(l,w) do { \
- if ((w) && ++waking < 5) { \
- tcp_write( SLAP_FD2SOCK(wake_sds[l][1]), "0", 1 ); \
- } \
-} while (0)
-#else /* ! NO_THREADS */
#define WAKE_LISTENER(l,w) do { \
if (w) { \
tcp_write( SLAP_FD2SOCK(wake_sds[l][1]), "0", 1 ); \
} \
} while (0)
-#endif /* ! NO_THREADS */
volatile sig_atomic_t slapd_shutdown = 0;
volatile sig_atomic_t slapd_gentle_shutdown = 0;
ldap_pvt_thread_mutex_unlock( &slap_daemon[tid].sd_mutex );
if ( at
-#if defined(HAVE_YIELDING_SELECT) || defined(NO_THREADS)
+#if defined(HAVE_YIELDING_SELECT)
&& ( tv.tv_sec || tv.tv_usec )
-#endif /* HAVE_YIELDING_SELECT || NO_THREADS */
+#endif /* HAVE_YIELDING_SELECT */
)
{
tvp = &tv;
static void print_slheap(int level, void *ctx);
#endif
-/* Keep memory context in a thread-local var, or in a global when no threads */
-#ifdef NO_THREADS
-static struct slab_heap *slheap;
-# define SET_MEMCTX(thrctx, memctx, sfree) ((void) (slheap = (memctx)))
-# define GET_MEMCTX(thrctx, memctxp) (*(memctxp) = slheap)
-#else
+/* Keep memory context in a thread-local var */
# define memctx_key ((void *) slap_sl_mem_init)
# define SET_MEMCTX(thrctx, memctx, kfree) \
ldap_pvt_thread_pool_setkey(thrctx,memctx_key, memctx,kfree, NULL,NULL)
((void) (*(memctxp) = NULL), \
(void) ldap_pvt_thread_pool_getkey(thrctx,memctx_key, memctxp,NULL), \
*(memctxp))
-#endif /* NO_THREADS */
-
/* Destroy the context, or if key==NULL clean it up for reuse. */
void
AC_TLS_TYPE=@WITH_TLS_TYPE@
AC_WITH_MODULES_ENABLED=@WITH_MODULES_ENABLED@
AC_ACI_ENABLED=aci@WITH_ACI_ENABLED@
-AC_THREADS=threads@BUILD_THREAD@
AC_LIBS_DYNAMIC=lib@BUILD_LIBS_DYNAMIC@
# sanitize
AC_refint AC_retcode AC_rwm AC_unique AC_syncprov AC_translucent \
AC_valsort \
AC_WITH_SASL AC_WITH_TLS AC_WITH_MODULES_ENABLED AC_ACI_ENABLED \
- AC_THREADS AC_LIBS_DYNAMIC AC_WITH_TLS AC_TLS_TYPE
+ AC_LIBS_DYNAMIC AC_WITH_TLS AC_TLS_TYPE
if test ! -x ../servers/slapd/slapd ; then
echo "Could not locate slapd(8)"
WITH_TLS_TYPE=${AC_TLS_TYPE-no}
ACI=${AC_ACI_ENABLED-acino}
-THREADS=${AC_THREADS-threadsno}
SLEEP0=${SLEEP0-1}
SLEEP1=${SLEEP1-7}
SLEEP2=${SLEEP2-15}
exit 0
fi
-if test $THREADS = "threadsno" ; then
- echo "Need threads support, test skipped"
- exit 0
-fi
-
if test $WITH_SASL = "yes" ; then
if test $USE_SASL != "no" ; then
if test $USE_SASL = "yes" ; then
if test $BACKLDAP = ldapno ; then
echo "ldap backend not available, test skipped"
else
- if test $THREADS = "threadsno" ; then
- echo "Need threads support, test skipped"
- else
- if test "x$RELAYS" != "x" ; then
- RELAYS="${RELAYS} "
- fi
- RELAYS="${RELAYS}ldap"
- fi
+ if test "x$RELAYS" != "x" ; then
+ RELAYS="${RELAYS} "
+ fi
+ RELAYS="${RELAYS}ldap"
fi
# back-meta
if test $BACKMETA = metano ; then
echo "meta backend not available, test skipped"
else
- if test $THREADS = "threadsno" ; then
- echo "Need threads support, test skipped"
- else
- if test "x$RELAYS" != "x" ; then
- RELAYS="${RELAYS} "
- fi
- RELAYS="${RELAYS}meta"
+ if test "x$RELAYS" != "x" ; then
+ RELAYS="${RELAYS} "
fi
+ RELAYS="${RELAYS}meta"
fi
fi
fi
first=1
for RELAY in $RELAYS ; do
- RUNIT=yes
- if test $THREADS = "threadsno" ; then
- case $RELAY in
- ldap|meta)
- echo "Need threads support, test skipped"
- RUNIT=no
- ;;
- esac
+ if test $first = 1 ; then
+ first=0
+ else
+ echo ">>>>> waiting for things to exit"
+ test $KILLSERVERS != no && wait
+ echo ""
+
+ mv -f $LOG1 $tmpfile
+ rm -rf $TESTDIR
fi
-
- if test $RUNIT = yes ; then
- if test $first = 1 ; then
- first=0
- else
- echo ">>>>> waiting for things to exit"
- test $KILLSERVERS != no && wait
- echo ""
-
- mv -f $LOG1 $tmpfile
- rm -rf $TESTDIR
- fi
- mkdir -p $TESTDIR $DBDIR1
+ mkdir -p $TESTDIR $DBDIR1
- if test -f $tmpfile ; then
- mv $tmpfile $LOG1
- fi
-
- . $SRCDIR/scripts/relay
+ if test -f $tmpfile ; then
+ mv $tmpfile $LOG1
fi
+
+ . $SRCDIR/scripts/relay
done
echo ">>>>> Test succeeded"
exit 0
fi
-if test $THREADS = threadsno ; then
- echo "Need threads support, test skipped"
- exit 0
-fi
-
mkdir -p $TESTDIR $DBDIR1 $DBDIR2 $DBDIR3
#