--- /dev/null
+/* $OpenLDAP$ */
+/*
+ * Copyright 1998-2000 The OpenLDAP Foundation, Redwood City, California, USA
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted only
+ * as authorized by the OpenLDAP Public License. A copy of this
+ * license is available at http://www.OpenLDAP.org/license.html or
+ * in file LICENSE in the top-level directory of the distribution.
+ */
+/* ldap_int_thread.h - ldap internal thread wrappers header file */
+
+#ifndef _LDAP_INT_THREAD_H
+#define _LDAP_INT_THREAD_H
+
+#include "ldap_cdefs.h"
+
+#if defined( HAVE_PTHREADS )
+/**********************************
+ * *
+ * definitions for POSIX Threads *
+ * *
+ **********************************/
+
+#include <pthread.h>
+#ifdef HAVE_SCHED_H
+#include <sched.h>
+#endif
+
+LDAP_BEGIN_DECL
+
+typedef pthread_t ldap_int_thread_t;
+typedef pthread_mutex_t ldap_int_thread_mutex_t;
+typedef pthread_cond_t ldap_int_thread_cond_t;
+
+#if defined( _POSIX_REENTRANT_FUNCTIONS ) || \
+ defined( _POSIX_THREAD_SAFE_FUNCTIONS ) || \
+ defined( _POSIX_THREADSAFE_FUNCTIONS )
+#define HAVE_REENTRANT_FUNCTIONS 1
+#endif
+
+#if defined( HAVE_PTHREAD_GETCONCURRENCY ) || \
+ defined( HAVE_THR_GETCONCURRENCY )
+#define HAVE_GETCONCURRENCY 1
+#endif
+
+#if defined( HAVE_PTHREAD_SETCONCURRENCY ) || \
+ defined( HAVE_THR_SETCONCURRENCY )
+#define HAVE_SETCONCURRENCY 1
+#endif
+
+LDAP_END_DECL
+
+#elif defined ( HAVE_MACH_CTHREADS )
+/**********************************
+ * *
+ * definitions for Mach CThreads *
+ * *
+ **********************************/
+
+#include <mach/cthreads.h>
+
+LDAP_BEGIN_DECL
+
+typedef cthread_t ldap_int_thread_t;
+typedef struct mutex ldap_int_thread_mutex_t;
+typedef struct condition ldap_int_thread_cond_t;
+
+LDAP_END_DECL
+
+#elif defined( HAVE_GNU_PTH )
+/***********************************
+ * *
+ * thread definitions for GNU Pth *
+ * *
+ ***********************************/
+
+#define PTH_SYSCALL_SOFT 1
+#include <pth.h>
+
+LDAP_BEGIN_DECL
+
+typedef pth_t ldap_int_thread_t;
+typedef pth_mutex_t ldap_int_thread_mutex_t;
+typedef pth_cond_t ldap_int_thread_cond_t;
+
+LDAP_END_DECL
+
+
+#elif defined( HAVE_THR )
+/********************************************
+ * *
+ * thread definitions for Solaris LWP (THR) *
+ * *
+ ********************************************/
+
+#include <thread.h>
+#include <synch.h>
+
+LDAP_BEGIN_DECL
+
+typedef thread_t ldap_int_thread_t;
+typedef mutex_t ldap_int_thread_mutex_t;
+typedef cond_t ldap_int_thread_cond_t;
+
+#define HAVE_REENTRANT_FUNCTIONS 1
+
+#ifdef HAVE_THR_GETCONCURRENCY
+#define HAVE_GETCONCURRENCY 1
+#endif
+#ifdef HAVE_THR_SETCONCURRENCY
+#define HAVE_SETCONCURRENCY 1
+#endif
+
+LDAP_END_DECL
+
+#elif defined( HAVE_LWP )
+/*************************************
+ * *
+ * thread definitions for SunOS LWP *
+ * *
+ *************************************/
+
+#include <lwp/lwp.h>
+#include <lwp/stackdep.h>
+
+LDAP_BEGIN_DECL
+
+typedef thread_t ldap_int_thread_t;
+typedef mon_t ldap_int_thread_mutex_t;
+struct ldap_int_thread_lwp_cv {
+ int lcv_created;
+ cv_t lcv_cv;
+};
+typedef struct ldap_int_thread_lwp_cv ldap_int_thread_cond_t;
+
+#define HAVE_REENTRANT_FUNCTIONS 1
+
+LDAP_END_DECL
+
+#elif defined(HAVE_NT_THREADS)
+
+LDAP_BEGIN_DECL
+
+#include <process.h>
+#include <windows.h>
+
+typedef unsigned long ldap_int_thread_t;
+typedef HANDLE ldap_int_thread_mutex_t;
+typedef HANDLE ldap_int_thread_cond_t;
+
+LDAP_END_DECL
+
+#else
+
+/***********************************
+ * *
+ * thread definitions for no *
+ * underlying library support *
+ * *
+ ***********************************/
+
+LDAP_BEGIN_DECL
+
+#ifndef NO_THREADS
+#define NO_THREADS 1
+#endif
+
+typedef int ldap_int_thread_t;
+typedef int ldap_int_thread_mutex_t;
+typedef int ldap_int_thread_cond_t;
+
+LDAP_END_DECL
+
+#endif /* no threads support */
+
+LDAP_BEGIN_DECL
+
+LIBLDAP_F( int )
+ldap_int_thread_initialize LDAP_P(( void ));
+
+LIBLDAP_F( int )
+ldap_int_thread_destroy LDAP_P(( void ));
+
+LIBLDAP_F( unsigned int )
+ldap_int_thread_sleep LDAP_P(( unsigned int s ));
+
+#ifdef HAVE_GETCONCURRENCY
+LIBLDAP_F( int )
+ldap_int_thread_get_concurrency LDAP_P(( void ));
+#endif
+
+#ifdef HAVE_SETCONCURRENCY
+# ifndef LDAP_THREAD_CONCURRENCY
+ /* three concurrent threads should be enough */
+# define LDAP_THREAD_CONCURRENCY 3
+# endif
+LIBLDAP_F( int )
+ldap_int_thread_set_concurrency LDAP_P(( int ));
+#endif
+
+LIBLDAP_F( int )
+ldap_int_thread_create LDAP_P((
+ ldap_int_thread_t * thread,
+ int detach,
+ void *(*start_routine)( void * ),
+ void *arg));
+
+LIBLDAP_F( void )
+ldap_int_thread_exit LDAP_P(( void *retval ));
+
+LIBLDAP_F( int )
+ldap_int_thread_join LDAP_P(( ldap_int_thread_t thread, void **status ));
+
+LIBLDAP_F( int )
+ldap_int_thread_kill LDAP_P(( ldap_int_thread_t thread, int signo ));
+
+LIBLDAP_F( int )
+ldap_int_thread_yield LDAP_P(( void ));
+
+LIBLDAP_F( int )
+ldap_int_thread_cond_init LDAP_P(( ldap_int_thread_cond_t *cond ));
+
+LIBLDAP_F( int )
+ldap_int_thread_cond_destroy LDAP_P(( ldap_int_thread_cond_t *cond ));
+
+LIBLDAP_F( int )
+ldap_int_thread_cond_signal LDAP_P(( ldap_int_thread_cond_t *cond ));
+
+LIBLDAP_F( int )
+ldap_int_thread_cond_broadcast LDAP_P(( ldap_int_thread_cond_t *cond ));
+
+LIBLDAP_F( int )
+ldap_int_thread_cond_wait LDAP_P((
+ ldap_int_thread_cond_t *cond,
+ ldap_int_thread_mutex_t *mutex ));
+
+LIBLDAP_F( int )
+ldap_int_thread_mutex_init LDAP_P(( ldap_int_thread_mutex_t *mutex ));
+
+LIBLDAP_F( int )
+ldap_int_thread_mutex_destroy LDAP_P(( ldap_int_thread_mutex_t *mutex ));
+
+LIBLDAP_F( int )
+ldap_int_thread_mutex_lock LDAP_P(( ldap_int_thread_mutex_t *mutex ));
+
+LIBLDAP_F( int )
+ldap_int_thread_mutex_trylock LDAP_P(( ldap_int_thread_mutex_t *mutex ));
+
+LIBLDAP_F( int )
+ldap_int_thread_mutex_unlock LDAP_P(( ldap_int_thread_mutex_t *mutex ));
+
+LDAP_END_DECL
+
+#endif /* _LDAP_INT_THREAD_H */
#define _LDAP_PVT_THREAD_H
#include "ldap_cdefs.h"
-
-#if defined( HAVE_PTHREADS )
-/**********************************
- * *
- * definitions for POSIX Threads *
- * *
- **********************************/
-
-#include <pthread.h>
-#ifdef HAVE_SCHED_H
-#include <sched.h>
-#endif
-
-LDAP_BEGIN_DECL
-
-typedef pthread_t ldap_pvt_thread_t;
-typedef pthread_mutex_t ldap_pvt_thread_mutex_t;
-typedef pthread_cond_t ldap_pvt_thread_cond_t;
-
-#if defined( _POSIX_REENTRANT_FUNCTIONS ) || \
- defined( _POSIX_THREAD_SAFE_FUNCTIONS ) || \
- defined( _POSIX_THREADSAFE_FUNCTIONS )
-#define HAVE_REENTRANT_FUNCTIONS 1
-#endif
-
-#if defined( HAVE_PTHREAD_GETCONCURRENCY ) || \
- defined( HAVE_THR_GETCONCURRENCY )
-#define HAVE_GETCONCURRENCY 1
-#endif
-
-#if defined( HAVE_PTHREAD_SETCONCURRENCY ) || \
- defined( HAVE_THR_SETCONCURRENCY )
-#define HAVE_SETCONCURRENCY 1
-#endif
-
-LDAP_END_DECL
-
-#elif defined ( HAVE_MACH_CTHREADS )
-/**********************************
- * *
- * definitions for Mach CThreads *
- * *
- **********************************/
-
-#include <mach/cthreads.h>
-
-LDAP_BEGIN_DECL
-
-typedef cthread_t ldap_pvt_thread_t;
-typedef struct mutex ldap_pvt_thread_mutex_t;
-typedef struct condition ldap_pvt_thread_cond_t;
-
-LDAP_END_DECL
-
-#elif defined( HAVE_GNU_PTH )
-/***********************************
- * *
- * thread definitions for GNU Pth *
- * *
- ***********************************/
-
-#define PTH_SYSCALL_SOFT 1
-#include <pth.h>
-
-LDAP_BEGIN_DECL
-
-typedef pth_t ldap_pvt_thread_t;
-typedef pth_mutex_t ldap_pvt_thread_mutex_t;
-typedef pth_cond_t ldap_pvt_thread_cond_t;
-
-LDAP_END_DECL
-
-
-#elif defined( HAVE_THR )
-/********************************************
- * *
- * thread definitions for Solaris LWP (THR) *
- * *
- ********************************************/
-
-#include <thread.h>
-#include <synch.h>
-
-LDAP_BEGIN_DECL
-
-typedef thread_t ldap_pvt_thread_t;
-typedef mutex_t ldap_pvt_thread_mutex_t;
-typedef cond_t ldap_pvt_thread_cond_t;
-
-#define HAVE_REENTRANT_FUNCTIONS 1
-
-#ifdef HAVE_THR_GETCONCURRENCY
-#define HAVE_GETCONCURRENCY 1
-#endif
-#ifdef HAVE_THR_SETCONCURRENCY
-#define HAVE_SETCONCURRENCY 1
-#endif
-
-LDAP_END_DECL
-
-#elif defined( HAVE_LWP )
-/*************************************
- * *
- * thread definitions for SunOS LWP *
- * *
- *************************************/
-
-#include <lwp/lwp.h>
-#include <lwp/stackdep.h>
+#include "ldap_int_thread.h"
LDAP_BEGIN_DECL
-typedef thread_t ldap_pvt_thread_t;
-typedef mon_t ldap_pvt_thread_mutex_t;
-struct ldap_pvt_thread_lwp_cv {
- int lcv_created;
- cv_t lcv_cv;
-};
-typedef struct ldap_pvt_thread_lwp_cv ldap_pvt_thread_cond_t;
+typedef ldap_int_thread_t ldap_pvt_thread_t;
+typedef ldap_int_thread_mutex_t ldap_pvt_thread_mutex_t;
+typedef ldap_int_thread_cond_t ldap_pvt_thread_cond_t;
-#define HAVE_REENTRANT_FUNCTIONS 1
-
-LDAP_END_DECL
-
-#elif defined(HAVE_NT_THREADS)
-
-LDAP_BEGIN_DECL
-
-#include <process.h>
-#include <windows.h>
-
-typedef unsigned long ldap_pvt_thread_t;
-typedef HANDLE ldap_pvt_thread_mutex_t;
-typedef HANDLE ldap_pvt_thread_cond_t;
-
-LDAP_END_DECL
-
-#else
-
-/***********************************
- * *
- * thread definitions for no *
- * underlying library support *
- * *
- ***********************************/
-
-LDAP_BEGIN_DECL
-
-#ifndef NO_THREADS
-#define NO_THREADS 1
-#endif
-
-typedef int ldap_pvt_thread_t;
-typedef int ldap_pvt_thread_mutex_t;
-typedef int ldap_pvt_thread_cond_t;
-
-LDAP_END_DECL
-
-#endif /* no threads support */
-
-LDAP_BEGIN_DECL
LIBLDAP_F( int )
ldap_pvt_thread_initialize LDAP_P(( void ));
LIBLDAP_F( unsigned int )
ldap_pvt_thread_sleep LDAP_P(( unsigned int s ));
-#ifdef HAVE_GETCONCURRENCY
LIBLDAP_F( int )
ldap_pvt_thread_get_concurrency LDAP_P(( void ));
-#endif
-#ifdef HAVE_SETCONCURRENCY
-# ifndef LDAP_THREAD_CONCURRENCY
+#ifndef LDAP_THREAD_CONCURRENCY
/* three concurrent threads should be enough */
-# define LDAP_THREAD_CONCURRENCY 3
-# endif
+#define LDAP_THREAD_CONCURRENCY 3
+#endif
LIBLDAP_F( int )
ldap_pvt_thread_set_concurrency LDAP_P(( int ));
-#endif
#define LDAP_PVT_THREAD_CREATE_JOINABLE 0
#define LDAP_PVT_THREAD_CREATE_DETACHED 1
charray.c tls.c dn.c os-local.c dnssrv.c \
utf-8.c
SRCS = thr_posix.c thr_cthreads.c thr_thr.c thr_lwp.c thr_nt.c \
- thr_pth.c thr_sleep.c thr_stub.c rdwr.c
+ thr_pth.c thr_sleep.c thr_stub.c rdwr.c threads.c
OBJS = extended.lo \
bind.lo controls.lo open.lo result.lo error.lo compare.lo search.lo \
modify.lo add.lo modrdn.lo delete.lo abandon.lo ufn.lo cache.lo \
request.lo os-ip.lo url.lo \
init.lo options.lo print.lo string.lo util-int.lo schema.lo \
thr_posix.lo thr_cthreads.lo thr_thr.lo thr_lwp.lo thr_nt.lo \
- thr_pth.lo thr_sleep.lo thr_stub.lo rdwr.lo \
+ thr_pth.lo thr_sleep.lo thr_stub.lo rdwr.lo threads.lo \
charray.lo tls.lo dn.lo os-local.lo dnssrv.lo \
utf-8.lo
#include "portable.h"
#if defined( HAVE_MACH_CTHREADS )
-#include "ldap_pvt_thread.h"
+#include "ldap_int_thread.h"
/***********************************************************************
* *
***********************************************************************/
int
-ldap_pvt_thread_initialize( void )
+ldap_int_thread_initialize( void )
{
return 0;
}
int
-ldap_pvt_thread_destroy( void )
+ldap_int_thread_destroy( void )
{
return 0;
}
int
-ldap_pvt_thread_create( ldap_pvt_thread_t * thread,
+ldap_int_thread_create( ldap_int_thread_t * thread,
int detach,
void *(*start_routine)( void *), void *arg)
{
}
void
-ldap_pvt_thread_exit( void *retval )
+ldap_int_thread_exit( void *retval )
{
cthread_exit( (any_t) retval );
}
int
-ldap_pvt_thread_join( ldap_pvt_thread_t thread, void **thread_return )
+ldap_int_thread_join( ldap_int_thread_t thread, void **thread_return )
{
void *status;
status = (void *) cthread_join ( thread );
}
int
-ldap_pvt_thread_kill( ldap_pvt_thread_t thread, int signo )
+ldap_int_thread_kill( ldap_int_thread_t thread, int signo )
{
return 0;
}
int
-ldap_pvt_thread_yield( void )
+ldap_int_thread_yield( void )
{
cthread_yield();
return 0;
}
int
-ldap_pvt_thread_cond_init( ldap_pvt_thread_cond_t *cond )
+ldap_int_thread_cond_init( ldap_int_thread_cond_t *cond )
{
condition_init( cond );
return( 0 );
}
int
-ldap_pvt_thread_cond_destroy( ldap_pvt_thread_cond_t *cond )
+ldap_int_thread_cond_destroy( ldap_int_thread_cond_t *cond )
{
condition_clear( cond );
return( 0 );
}
int
-ldap_pvt_thread_cond_signal( ldap_pvt_thread_cond_t *cond )
+ldap_int_thread_cond_signal( ldap_int_thread_cond_t *cond )
{
condition_signal( cond );
return( 0 );
}
int
-ldap_pvt_thread_cond_broadcast( ldap_pvt_thread_cond_t *cond )
+ldap_int_thread_cond_broadcast( ldap_int_thread_cond_t *cond )
{
condition_broadcast( cond );
return( 0 );
}
int
-ldap_pvt_thread_cond_wait( ldap_pvt_thread_cond_t *cond,
- ldap_pvt_thread_mutex_t *mutex )
+ldap_int_thread_cond_wait( ldap_int_thread_cond_t *cond,
+ ldap_int_thread_mutex_t *mutex )
{
condition_wait( cond, mutex );
return( 0 );
}
int
-ldap_pvt_thread_mutex_init( ldap_pvt_thread_mutex_t *mutex )
+ldap_int_thread_mutex_init( ldap_int_thread_mutex_t *mutex )
{
mutex_init( mutex );
mutex->name = NULL;
}
int
-ldap_pvt_thread_mutex_destroy( ldap_pvt_thread_mutex_t *mutex )
+ldap_int_thread_mutex_destroy( ldap_int_thread_mutex_t *mutex )
{
mutex_clear( mutex );
return ( 0 );
}
int
-ldap_pvt_thread_mutex_lock( ldap_pvt_thread_mutex_t *mutex )
+ldap_int_thread_mutex_lock( ldap_int_thread_mutex_t *mutex )
{
mutex_lock( mutex );
return ( 0 );
}
int
-ldap_pvt_thread_mutex_unlock( ldap_pvt_thread_mutex_t *mutex )
+ldap_int_thread_mutex_unlock( ldap_int_thread_mutex_t *mutex )
{
mutex_unlock( mutex );
return ( 0 );
}
int
-ldap_pvt_thread_mutex_trylock( ldap_pvt_thread_mutex_t *mutex )
+ldap_int_thread_mutex_trylock( ldap_int_thread_mutex_t *mutex )
{
return mutex_try_lock( mutex );
}
#include "ldap-int.h"
-#include "ldap_pvt_thread.h"
+#include "ldap_int_thread.h"
#include <lwp/lwp.h>
#include <lwp/stackdep.h>
* Initialize LWP by spinning of a schedular
*/
int
-ldap_pvt_thread_initialize( void )
+ldap_int_thread_initialize( void )
{
thread_t tid;
stkalign_t *stack;
}
int
-ldap_pvt_thread_destroy( void )
+ldap_int_thread_destroy( void )
{
/* need to destory lwp_scheduler thread and clean up private
variables */
static struct stackinfo *stacks;
-static stkalign_t * ldap_pvt_thread_get_stack( int *stacknop )
+static stkalign_t * ldap_int_thread_get_stack( int *stacknop )
{
int i;
}
static void
-ldap_pvt_thread_free_stack( int stackno )
+ldap_int_thread_free_stack( int stackno )
{
if ( stackno < 0 || stackno > MAX_THREADS ) {
Debug( LDAP_DEBUG_ANY, "free_stack of bogus stack %d\n",
{
(*func)( arg );
- ldap_pvt_thread_free_stack( stackno );
+ ldap_int_thread_free_stack( stackno );
}
int
-ldap_pvt_thread_create( ldap_pvt_thread_t * thread,
+ldap_int_thread_create( ldap_int_thread_t * thread,
int detach,
void *(*start_routine)( void *),
void *arg)
stkalign_t *stack;
int stackno;
- if ( (stack = ldap_pvt_thread_get_stack( &stackno )) == NULL ) {
+ if ( (stack = ldap_int_thread_get_stack( &stackno )) == NULL ) {
return( -1 );
}
return( lwp_create( thread, lwp_create_stack, MINPRIO, 0,
}
void
-ldap_pvt_thread_exit( void *retval )
+ldap_int_thread_exit( void *retval )
{
lwp_destroy( SELF );
}
unsigned int
-ldap_pvt_thread_sleep(
+ldap_int_thread_sleep(
unsigned int interval
)
{
}
int
-ldap_pvt_thread_join( ldap_pvt_thread_t thread, void **thread_return )
+ldap_int_thread_join( ldap_int_thread_t thread, void **thread_return )
{
lwp_join( thread );
return 0;
}
int
-ldap_pvt_thread_kill( ldap_pvt_thread_t thread, int signo )
+ldap_int_thread_kill( ldap_int_thread_t thread, int signo )
{
return 0;
}
int
-ldap_pvt_thread_yield( void )
+ldap_int_thread_yield( void )
{
lwp_yield( SELF );
return 0;
}
int
-ldap_pvt_thread_cond_init( ldap_pvt_thread_cond_t *cond )
+ldap_int_thread_cond_init( ldap_int_thread_cond_t *cond )
{
/*
* lwp cv_create requires the monitor id be passed in
}
int
-ldap_pvt_thread_cond_signal( ldap_pvt_thread_cond_t *cond )
+ldap_int_thread_cond_signal( ldap_int_thread_cond_t *cond )
{
return( cond->lcv_created ? cv_notify( cv->lcv_cv ) : 0 );
}
int
-ldap_pvt_thread_cond_wait( ldap_pvt_thread_cond_t *cond,
- ldap_pvt_thread_mutex_t *mutex )
+ldap_int_thread_cond_wait( ldap_int_thread_cond_t *cond,
+ ldap_int_thread_mutex_t *mutex )
{
if ( ! cond->lcv_created ) {
cv_create( &cond->lcv_cv, *mutex );
}
int
-ldap_pvt_thread_mutex_init( ldap_pvt_thread_mutex_t *mutex )
+ldap_int_thread_mutex_init( ldap_int_thread_mutex_t *mutex )
{
return( mon_create( mutex ) );
}
int
-ldap_pvt_thread_mutex_destroy( ldap_pvt_thread_mutex_t *mutex )
+ldap_int_thread_mutex_destroy( ldap_int_thread_mutex_t *mutex )
{
return( mon_destroy( *mutex ) );
}
int
-ldap_pvt_thread_mutex_lock( ldap_pvt_thread_mutex_t *mutex )
+ldap_int_thread_mutex_lock( ldap_int_thread_mutex_t *mutex )
{
return( mon_enter( *mutex ) );
}
int
-ldap_pvt_thread_mutex_unlock( ldap_pvt_thread_mutex_t *mutex )
+ldap_int_thread_mutex_unlock( ldap_int_thread_mutex_t *mutex )
{
return( mon_exit( *mutex ) );
}
int
-ldap_pvt_thread_mutex_trylock( ldap_pvt_thread_mutex_t *mp )
+ldap_int_thread_mutex_trylock( ldap_int_thread_mutex_t *mp )
{
return( mon_cond_enter( *mp ) );
}
int
-ldap_pvt_thread_cond_destroy( ldap_pvt_thread_cond_t *cv )
+ldap_int_thread_cond_destroy( ldap_pvt_thread_cond_t *cv )
{
return( cv->lcv_created ? cv_destroy( cv->lcv_cv ) : 0 );
}
int
-ldap_pvt_thread_cond_broadcast( ldap_pvt_thread_cond_t *cv )
+ldap_int_thread_cond_broadcast( ldap_int_thread_cond_t *cv )
{
return( cv->lcv_created ? cv_broadcast( cv->lcv_cv ) : 0 );
}
#if defined( HAVE_NT_THREADS )
-#include "ldap_pvt_thread.h"
+#include "ldap_int_thread.h"
int
-ldap_pvt_thread_initialize( void )
+ldap_int_thread_initialize( void )
{
return 0;
}
int
-ldap_pvt_thread_destroy( void )
+ldap_int_thread_destroy( void )
{
return 0;
}
int
-ldap_pvt_thread_create( ldap_pvt_thread_t * thread,
+ldap_int_thread_create( ldap_int_thread_t * thread,
int detach,
void *(*start_routine)( void *),
void *arg)
{
- *thread = (ldap_pvt_thread_t)_beginthread( (void *) start_routine,
+ *thread = (ldap_int_thread_t)_beginthread( (void *) start_routine,
0, arg );
return ( (unsigned long)*thread == -1 ? -1 : 0 );
}
void
-ldap_pvt_thread_exit( void *retval )
+ldap_int_thread_exit( void *retval )
{
_endthread( );
}
int
-ldap_pvt_thread_join( ldap_pvt_thread_t thread, void **thread_return )
+ldap_int_thread_join( ldap_int_thread_t thread, void **thread_return )
{
DWORD status;
status = WaitForSingleObject( (HANDLE) thread, INFINITE );
}
int
-ldap_pvt_thread_kill( ldap_pvt_thread_t thread, int signo )
+ldap_int_thread_kill( ldap_int_thread_t thread, int signo )
{
return 0;
}
int
-ldap_pvt_thread_yield( void )
+ldap_int_thread_yield( void )
{
Sleep( 0 );
return 0;
}
int
-ldap_pvt_thread_cond_init( ldap_pvt_thread_cond_t *cond )
+ldap_int_thread_cond_init( ldap_int_thread_cond_t *cond )
{
*cond = CreateEvent( NULL, FALSE, FALSE, NULL );
return( 0 );
}
int
-ldap_pvt_thread_cond_destroy( ldap_pvt_thread_cond_t *cv )
+ldap_int_thread_cond_destroy( ldap_int_thread_cond_t *cv )
{
CloseHandle( *cv );
return( 0 );
}
int
-ldap_pvt_thread_cond_signal( ldap_pvt_thread_cond_t *cond )
+ldap_int_thread_cond_signal( ldap_int_thread_cond_t *cond )
{
SetEvent( *cond );
return( 0 );
}
int
-ldap_pvt_thread_cond_wait( ldap_pvt_thread_cond_t *cond,
- ldap_pvt_thread_mutex_t *mutex )
+ldap_int_thread_cond_wait( ldap_int_thread_cond_t *cond,
+ ldap_int_thread_mutex_t *mutex )
{
ReleaseMutex( *mutex );
SignalObjectAndWait( *mutex, *cond, INFINITE, FALSE );
}
int
-ldap_pvt_thread_cond_broadcast( ldap_pvt_thread_cond_t *cond )
+ldap_int_thread_cond_broadcast( ldap_int_thread_cond_t *cond )
{
SetEvent( *cond );
return( 0 );
}
int
-ldap_pvt_thread_mutex_init( ldap_pvt_thread_mutex_t *mutex )
+ldap_int_thread_mutex_init( ldap_int_thread_mutex_t *mutex )
{
*mutex = CreateMutex( NULL, 0, NULL );
return ( 0 );
}
int
-ldap_pvt_thread_mutex_destroy( ldap_pvt_thread_mutex_t *mutex )
+ldap_int_thread_mutex_destroy( ldap_int_thread_mutex_t *mutex )
{
CloseHandle( *mutex );
return ( 0 );
}
int
-ldap_pvt_thread_mutex_lock( ldap_pvt_thread_mutex_t *mutex )
+ldap_int_thread_mutex_lock( ldap_int_thread_mutex_t *mutex )
{
WaitForSingleObject( *mutex, INFINITE );
return ( 0 );
}
int
-ldap_pvt_thread_mutex_unlock( ldap_pvt_thread_mutex_t *mutex )
+ldap_int_thread_mutex_unlock( ldap_int_thread_mutex_t *mutex )
{
ReleaseMutex( *mutex );
return ( 0 );
}
int
-ldap_pvt_thread_mutex_trylock( ldap_pvt_thread_mutex_t *mp )
+ldap_int_thread_mutex_trylock( ldap_int_thread_mutex_t *mp )
{
DWORD status;
#include <ac/errno.h>
-#include "ldap_pvt_thread.h"
+#include "ldap_int_thread.h"
#if HAVE_PTHREADS_D4
int
-ldap_pvt_thread_initialize( void )
+ldap_int_thread_initialize( void )
{
#if defined( LDAP_THREAD_CONCURRENCY ) && HAVE_PTHREAD_SETCONCURRENCY
- ldap_pvt_thread_set_concurrency( LDAP_THREAD_CONCURRENCY );
+ ldap_int_thread_set_concurrency( LDAP_THREAD_CONCURRENCY );
#endif
return 0;
}
int
-ldap_pvt_thread_destroy( void )
+ldap_int_thread_destroy( void )
{
return 0;
}
#ifdef HAVE_PTHREAD_SETCONCURRENCY
int
-ldap_pvt_thread_set_concurrency(int n)
+ldap_int_thread_set_concurrency(int n)
{
#ifdef HAVE_PTHREAD_SETCONCURRENCY
return pthread_setconcurrency( n );
#ifdef HAVE_PTHREAD_GETCONCURRENCY
int
-ldap_pvt_thread_get_concurrency(void)
+ldap_int_thread_get_concurrency(void)
{
#ifdef HAVE_PTHREAD_GETCONCURRENCY
return pthread_getconcurrency();
#endif
int
-ldap_pvt_thread_create( ldap_pvt_thread_t * thread,
+ldap_int_thread_create( ldap_int_thread_t * thread,
int detach,
void *(*start_routine)( void * ),
void *arg)
}
void
-ldap_pvt_thread_exit( void *retval )
+ldap_int_thread_exit( void *retval )
{
pthread_exit( retval );
}
int
-ldap_pvt_thread_join( ldap_pvt_thread_t thread, void **thread_return )
+ldap_int_thread_join( ldap_int_thread_t thread, void **thread_return )
{
#if !defined( HAVE_PTHREADS_FINAL )
void *dummy;
}
int
-ldap_pvt_thread_kill( ldap_pvt_thread_t thread, int signo )
+ldap_int_thread_kill( ldap_int_thread_t thread, int signo )
{
#ifdef HAVE_PTHREAD_KILL
return pthread_kill( thread, signo );
}
int
-ldap_pvt_thread_yield( void )
+ldap_int_thread_yield( void )
{
#ifdef _POSIX_THREAD_IS_GNU_PTH
sched_yield();
}
int
-ldap_pvt_thread_cond_init( ldap_pvt_thread_cond_t *cond )
+ldap_int_thread_cond_init( ldap_int_thread_cond_t *cond )
{
return pthread_cond_init( cond, LDAP_PVT_THREAD_CONDATTR_DEFAULT );
}
int
-ldap_pvt_thread_cond_destroy( ldap_pvt_thread_cond_t *cond )
+ldap_int_thread_cond_destroy( ldap_int_thread_cond_t *cond )
{
return pthread_cond_destroy( cond );
}
int
-ldap_pvt_thread_cond_signal( ldap_pvt_thread_cond_t *cond )
+ldap_int_thread_cond_signal( ldap_int_thread_cond_t *cond )
{
return pthread_cond_signal( cond );
}
int
-ldap_pvt_thread_cond_broadcast( ldap_pvt_thread_cond_t *cond )
+ldap_int_thread_cond_broadcast( ldap_int_thread_cond_t *cond )
{
return pthread_cond_broadcast( cond );
}
int
-ldap_pvt_thread_cond_wait( ldap_pvt_thread_cond_t *cond,
- ldap_pvt_thread_mutex_t *mutex )
+ldap_int_thread_cond_wait( ldap_int_thread_cond_t *cond,
+ ldap_int_thread_mutex_t *mutex )
{
return pthread_cond_wait( cond, mutex );
}
int
-ldap_pvt_thread_mutex_init( ldap_pvt_thread_mutex_t *mutex )
+ldap_int_thread_mutex_init( ldap_int_thread_mutex_t *mutex )
{
return pthread_mutex_init( mutex, LDAP_PVT_THREAD_MUTEXATTR_DEFAULT );
}
int
-ldap_pvt_thread_mutex_destroy( ldap_pvt_thread_mutex_t *mutex )
+ldap_int_thread_mutex_destroy( ldap_int_thread_mutex_t *mutex )
{
return pthread_mutex_destroy( mutex );
}
int
-ldap_pvt_thread_mutex_lock( ldap_pvt_thread_mutex_t *mutex )
+ldap_int_thread_mutex_lock( ldap_int_thread_mutex_t *mutex )
{
return pthread_mutex_lock( mutex );
}
int
-ldap_pvt_thread_mutex_trylock( ldap_pvt_thread_mutex_t *mutex )
+ldap_int_thread_mutex_trylock( ldap_int_thread_mutex_t *mutex )
{
return pthread_mutex_trylock( mutex );
}
int
-ldap_pvt_thread_mutex_unlock( ldap_pvt_thread_mutex_t *mutex )
+ldap_int_thread_mutex_unlock( ldap_int_thread_mutex_t *mutex )
{
return pthread_mutex_unlock( mutex );
}
#if defined( HAVE_GNU_PTH )
-#include "ldap_pvt_thread.h"
+#include "ldap_int_thread.h"
/*******************
* *
static pth_attr_t detach_attr;
int
-ldap_pvt_thread_initialize( void )
+ldap_int_thread_initialize( void )
{
detach_attr = pth_attr_new();
pth_attr_set( detach_attr, PTH_ATTR_JOINABLE, FALSE );
}
int
-ldap_pvt_thread_destroy( void )
+ldap_int_thread_destroy( void )
{
pth_attr_destroy(detach_attr);
pth_kill();
}
int
-ldap_pvt_thread_create( ldap_pvt_thread_t * thread,
+ldap_int_thread_create( ldap_int_thread_t * thread,
int detach,
void *(*start_routine)( void *),
void *arg)
}
void
-ldap_pvt_thread_exit( void *retval )
+ldap_int_thread_exit( void *retval )
{
pth_exit( retval );
}
-int ldap_pvt_thread_join( ldap_pvt_thread_t thread, void **thread_return )
+int ldap_int_thread_join( ldap_int_thread_t thread, void **thread_return )
{
pth_join( thread, thread_return );
return 0;
}
int
-ldap_pvt_thread_kill( ldap_pvt_thread_t thread, int signo )
+ldap_int_thread_kill( ldap_int_thread_t thread, int signo )
{
pth_raise( thread, signo );
return 0;
}
int
-ldap_pvt_thread_yield( void )
+ldap_int_thread_yield( void )
{
pth_yield(NULL);
return 0;
}
int
-ldap_pvt_thread_cond_init( ldap_pvt_thread_cond_t *cond )
+ldap_int_thread_cond_init( ldap_int_thread_cond_t *cond )
{
return( pth_cond_init( cond ) );
}
int
-ldap_pvt_thread_cond_signal( ldap_pvt_thread_cond_t *cond )
+ldap_int_thread_cond_signal( ldap_int_thread_cond_t *cond )
{
return( pth_cond_notify( cond, 0 ) );
}
int
-ldap_pvt_thread_cond_broadcast( ldap_pvt_thread_cond_t *cond )
+ldap_int_thread_cond_broadcast( ldap_int_thread_cond_t *cond )
{
return( pth_cond_notify( cond, 1 ) );
}
int
-ldap_pvt_thread_cond_wait( ldap_pvt_thread_cond_t *cond,
- ldap_pvt_thread_mutex_t *mutex )
+ldap_int_thread_cond_wait( ldap_int_thread_cond_t *cond,
+ ldap_int_thread_mutex_t *mutex )
{
return( pth_cond_await( cond, mutex, NULL ) );
}
int
-ldap_pvt_thread_cond_destroy( ldap_pvt_thread_cond_t *cv )
+ldap_int_thread_cond_destroy( ldap_int_thread_cond_t *cv )
{
return 0;
}
int
-ldap_pvt_thread_mutex_init( ldap_pvt_thread_mutex_t *mutex )
+ldap_int_thread_mutex_init( ldap_int_thread_mutex_t *mutex )
{
return( pth_mutex_init( mutex ) );
}
int
-ldap_pvt_thread_mutex_destroy( ldap_pvt_thread_mutex_t *mutex )
+ldap_int_thread_mutex_destroy( ldap_int_thread_mutex_t *mutex )
{
return 0;
}
int
-ldap_pvt_thread_mutex_lock( ldap_pvt_thread_mutex_t *mutex )
+ldap_int_thread_mutex_lock( ldap_int_thread_mutex_t *mutex )
{
return( pth_mutex_acquire( mutex, 0, NULL ) );
}
int
-ldap_pvt_thread_mutex_unlock( ldap_pvt_thread_mutex_t *mutex )
+ldap_int_thread_mutex_unlock( ldap_int_thread_mutex_t *mutex )
{
return( pth_mutex_release( mutex ) );
}
int
-ldap_pvt_thread_mutex_trylock( ldap_pvt_thread_mutex_t *mutex )
+ldap_int_thread_mutex_trylock( ldap_int_thread_mutex_t *mutex )
{
return( pth_mutex_acquire( mutex, 1, NULL ) );
}
#if defined( NO_THREADS )
-#include "ldap_pvt_thread.h"
+#include "ldap_int_thread.h"
/***********************************************************************
* *
***********************************************************************/
int
-ldap_pvt_thread_initialize( void )
+ldap_int_thread_initialize( void )
{
return 0;
}
int
-ldap_pvt_thread_destroy( void )
+ldap_int_thread_destroy( void )
{
return 0;
}
static void* ldap_int_status = NULL;
int
-ldap_pvt_thread_create( ldap_pvt_thread_t * thread,
+ldap_int_thread_create( ldap_int_thread_t * thread,
int detach,
void *(*start_routine)(void *),
void *arg)
}
void
-ldap_pvt_thread_exit( void *retval )
+ldap_int_thread_exit( void *retval )
{
if( retval != NULL ) {
ldap_int_status = retval;
}
int
-ldap_pvt_thread_join( ldap_pvt_thread_t thread, void **status )
+ldap_int_thread_join( ldap_int_thread_t thread, void **status )
{
if(status != NULL) *status = ldap_int_status;
return 0;
}
int
-ldap_pvt_thread_kill( ldap_pvt_thread_t thread, int signo )
+ldap_int_thread_kill( ldap_int_thread_t thread, int signo )
{
return 0;
}
int
-ldap_pvt_thread_yield( void )
+ldap_int_thread_yield( void )
{
return 0;
}
int
-ldap_pvt_thread_cond_init( ldap_pvt_thread_cond_t *cond )
+ldap_int_thread_cond_init( ldap_int_thread_cond_t *cond )
{
return 0;
}
int
-ldap_pvt_thread_cond_destroy( ldap_pvt_thread_cond_t *cond )
+ldap_int_thread_cond_destroy( ldap_int_thread_cond_t *cond )
{
return 0;
}
int
-ldap_pvt_thread_cond_signal( ldap_pvt_thread_cond_t *cond )
+ldap_int_thread_cond_signal( ldap_int_thread_cond_t *cond )
{
return 0;
}
int
-ldap_pvt_thread_cond_broadcast( ldap_pvt_thread_cond_t *cond )
+ldap_int_thread_cond_broadcast( ldap_int_thread_cond_t *cond )
{
return 0;
}
int
-ldap_pvt_thread_cond_wait( ldap_pvt_thread_cond_t *cond,
- ldap_pvt_thread_mutex_t *mutex )
+ldap_int_thread_cond_wait( ldap_int_thread_cond_t *cond,
+ ldap_int_thread_mutex_t *mutex )
{
return 0;
}
int
-ldap_pvt_thread_mutex_init( ldap_pvt_thread_mutex_t *mutex )
+ldap_int_thread_mutex_init( ldap_int_thread_mutex_t *mutex )
{
return 0;
}
int
-ldap_pvt_thread_mutex_destroy( ldap_pvt_thread_mutex_t *mutex )
+ldap_int_thread_mutex_destroy( ldap_int_thread_mutex_t *mutex )
{
return 0;
}
int
-ldap_pvt_thread_mutex_lock( ldap_pvt_thread_mutex_t *mutex )
+ldap_int_thread_mutex_lock( ldap_int_thread_mutex_t *mutex )
{
return 0;
}
int
-ldap_pvt_thread_mutex_unlock( ldap_pvt_thread_mutex_t *mutex )
+ldap_int_thread_mutex_unlock( ldap_int_thread_mutex_t *mutex )
{
return 0;
}
#if defined( HAVE_THR )
-#include "ldap_pvt_thread.h"
+#include "ldap_int_thread.h"
/*******************
* *
*******************/
int
-ldap_pvt_thread_initialize( void )
+ldap_int_thread_initialize( void )
{
#ifdef LDAP_THREAD_CONCURRENCY
thr_setconcurrency( LDAP_THREAD_CONCURRENCY );
}
int
-ldap_pvt_thread_destroy( void )
+ldap_int_thread_destroy( void )
{
return 0;
}
int
-ldap_pvt_thread_set_concurrency(int n)
+ldap_int_thread_set_concurrency(int n)
{
return thr_setconcurrency( n );
}
int
-ldap_pvt_thread_get_concurrency(void)
+ldap_int_thread_get_concurrency(void)
{
return thr_getconcurrency();
}
int
-ldap_pvt_thread_create( ldap_pvt_thread_t * thread,
+ldap_int_thread_create( ldap_int_thread_t * thread,
int detach,
void *(*start_routine)( void *),
void *arg)
}
void
-ldap_pvt_thread_exit( void *retval )
+ldap_int_thread_exit( void *retval )
{
thr_exit( NULL );
}
-int ldap_pvt_thread_join( ldap_pvt_thread_t thread, void **thread_return )
+int ldap_int_thread_join( ldap_int_thread_t thread, void **thread_return )
{
thr_join( thread, NULL, thread_return );
return 0;
}
int
-ldap_pvt_thread_kill( ldap_pvt_thread_t thread, int signo )
+ldap_int_thread_kill( ldap_int_thread_t thread, int signo )
{
thr_kill( thread, signo );
return 0;
}
int
-ldap_pvt_thread_yield( void )
+ldap_int_thread_yield( void )
{
thr_yield();
return 0;
}
int
-ldap_pvt_thread_cond_init( ldap_pvt_thread_cond_t *cond )
+ldap_int_thread_cond_init( ldap_int_thread_cond_t *cond )
{
return( cond_init( cond, USYNC_THREAD, NULL ) );
}
int
-ldap_pvt_thread_cond_signal( ldap_pvt_thread_cond_t *cond )
+ldap_int_thread_cond_signal( ldap_int_thread_cond_t *cond )
{
return( cond_signal( cond ) );
}
int
-ldap_pvt_thread_cond_broadcast( ldap_pvt_thread_cond_t *cv )
+ldap_int_thread_cond_broadcast( ldap_int_thread_cond_t *cv )
{
return( cond_broadcast( cv ) );
}
int
-ldap_pvt_thread_cond_wait( ldap_pvt_thread_cond_t *cond,
- ldap_pvt_thread_mutex_t *mutex )
+ldap_int_thread_cond_wait( ldap_int_thread_cond_t *cond,
+ ldap_int_thread_mutex_t *mutex )
{
return( cond_wait( cond, mutex ) );
}
int
-ldap_pvt_thread_cond_destroy( ldap_pvt_thread_cond_t *cv )
+ldap_int_thread_cond_destroy( ldap_int_thread_cond_t *cv )
{
return( cond_destroy( cv ) );
}
int
-ldap_pvt_thread_mutex_init( ldap_pvt_thread_mutex_t *mutex )
+ldap_int_thread_mutex_init( ldap_int_thread_mutex_t *mutex )
{
return( mutex_init( mutex, USYNC_THREAD, NULL ) );
}
int
-ldap_pvt_thread_mutex_destroy( ldap_pvt_thread_mutex_t *mutex )
+ldap_int_thread_mutex_destroy( ldap_int_thread_mutex_t *mutex )
{
return( mutex_destroy( mutex ) );
}
int
-ldap_pvt_thread_mutex_lock( ldap_pvt_thread_mutex_t *mutex )
+ldap_int_thread_mutex_lock( ldap_int_thread_mutex_t *mutex )
{
return( mutex_lock( mutex ) );
}
int
-ldap_pvt_thread_mutex_unlock( ldap_pvt_thread_mutex_t *mutex )
+ldap_int_thread_mutex_unlock( ldap_int_thread_mutex_t *mutex )
{
return( mutex_unlock( mutex ) );
}
int
-ldap_pvt_thread_mutex_trylock( ldap_pvt_thread_mutex_t *mp )
+ldap_int_thread_mutex_trylock( ldap_int_thread_mutex_t *mp )
{
return( mutex_trylock( mp ) );
}
--- /dev/null
+/* $OpenLDAP$ */
+/*
+ * Copyright 1998-2000 The OpenLDAP Foundation, Redwood City, California, USA
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted only
+ * as authorized by the OpenLDAP Public License. A copy of this
+ * license is available at http://www.OpenLDAP.org/license.html or
+ * in file LICENSE in the top-level directory of the distribution.
+ */
+
+#include "portable.h"
+
+#include "ldap_int_thread.h"
+#include "ldap_pvt_thread.h"
+
+LIBLDAP_F( int )
+ldap_pvt_thread_initialize ( void )
+{
+ return ldap_int_thread_initialize();
+}
+
+LIBLDAP_F( int )
+ldap_pvt_thread_destroy ( void )
+{
+ return ldap_int_thread_destroy();
+}
+
+LIBLDAP_F( int )
+ldap_pvt_thread_get_concurrency ( void )
+{
+#ifdef HAVE_GETCONCURRENCY
+ return ldap_int_thread_get_concurrency();
+#else
+ return 1;
+#endif
+}
+
+LIBLDAP_F( int )
+ldap_pvt_thread_set_concurrency ( int concurrency )
+{
+#ifdef HAVE_SETCONCURRENCY
+ return ldap_int_thread_set_concurrency(concurrency);
+#else
+ return 1;
+#endif
+}
+
+LIBLDAP_F( int )
+ldap_pvt_thread_create (
+ ldap_pvt_thread_t * thread,
+ int detach,
+ void *(*start_routine)( void * ),
+ void *arg)
+{
+ return ldap_int_thread_create(thread, detach, start_routine, arg);
+}
+
+LIBLDAP_F( void )
+ldap_pvt_thread_exit ( void *retval )
+{
+ ldap_int_thread_exit(retval);
+}
+
+LIBLDAP_F( int )
+ldap_pvt_thread_join ( ldap_pvt_thread_t thread, void **status )
+{
+ return ldap_int_thread_join(thread, status);
+}
+
+LIBLDAP_F( int )
+ldap_pvt_thread_kill ( ldap_pvt_thread_t thread, int signo )
+{
+ return ldap_int_thread_kill(thread, signo);
+}
+
+LIBLDAP_F( int )
+ldap_pvt_thread_yield ( void )
+{
+ return ldap_int_thread_yield();
+}
+
+LIBLDAP_F( int )
+ldap_pvt_thread_cond_init ( ldap_pvt_thread_cond_t *cond )
+{
+ return ldap_int_thread_cond_init(cond);
+}
+
+LIBLDAP_F( int )
+ldap_pvt_thread_cond_destroy ( ldap_pvt_thread_cond_t *cond )
+{
+ return ldap_int_thread_cond_destroy(cond);
+}
+
+LIBLDAP_F( int )
+ldap_pvt_thread_cond_signal ( ldap_pvt_thread_cond_t *cond )
+{
+ return ldap_int_thread_cond_signal(cond);
+}
+
+LIBLDAP_F( int )
+ldap_pvt_thread_cond_broadcast ( ldap_pvt_thread_cond_t *cond )
+{
+ return ldap_int_thread_cond_broadcast(cond);
+}
+
+LIBLDAP_F( int )
+ldap_pvt_thread_cond_wait (
+ ldap_pvt_thread_cond_t *cond,
+ ldap_pvt_thread_mutex_t *mutex )
+{
+ return ldap_int_thread_cond_wait(cond, mutex);
+}
+
+LIBLDAP_F( int )
+ldap_pvt_thread_mutex_init ( ldap_pvt_thread_mutex_t *mutex )
+{
+ return ldap_int_thread_mutex_init(mutex);
+}
+
+LIBLDAP_F( int )
+ldap_pvt_thread_mutex_destroy ( ldap_pvt_thread_mutex_t *mutex )
+{
+ return ldap_int_thread_mutex_destroy(mutex);
+}
+
+LIBLDAP_F( int )
+ldap_pvt_thread_mutex_lock ( ldap_pvt_thread_mutex_t *mutex )
+{
+ return ldap_int_thread_mutex_lock(mutex);
+}
+
+LIBLDAP_F( int )
+ldap_pvt_thread_mutex_trylock ( ldap_pvt_thread_mutex_t *mutex )
+{
+ return ldap_int_thread_mutex_trylock(mutex);
+}
+
+LIBLDAP_F( int )
+ldap_pvt_thread_mutex_unlock ( ldap_pvt_thread_mutex_t *mutex )
+{
+ return ldap_int_thread_mutex_unlock(mutex);
+}