*/
#ifndef _LDAP_PVT_THREAD_H
-#define _LDAP_PVT_THREAD_H
+#define _LDAP_PVT_THREAD_H /* libldap_r/ldap_thr_debug.h #undefines this */
#include "ldap_cdefs.h"
#include "ldap_int_thread.h"
LDAP_BEGIN_DECL
-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;
+#ifndef LDAP_PVT_THREAD_H_DONE
+typedef ldap_int_thread_t ldap_pvt_thread_t;
+#ifdef LDAP_THREAD_DEBUG_WRAP
+typedef ldap_debug_thread_mutex_t ldap_pvt_thread_mutex_t;
+typedef ldap_debug_thread_cond_t ldap_pvt_thread_cond_t;
+typedef ldap_debug_thread_rdwr_t ldap_pvt_thread_rdwr_t;
+#else
+typedef ldap_int_thread_mutex_t ldap_pvt_thread_mutex_t;
+typedef ldap_int_thread_cond_t ldap_pvt_thread_cond_t;
+typedef ldap_int_thread_rdwr_t ldap_pvt_thread_rdwr_t;
+#endif
+#endif /* !LDAP_PVT_THREAD_H_DONE */
+
+#if 0 && defined(LDAP_DEVEL)
+/* must also be defined in slapd.h */
+#define LDAP_PVT_THREAD_POOL_SEM_LOAD_CONTROL
+#endif
+
+#define ldap_pvt_thread_equal ldap_int_thread_equal
LDAP_F( int )
ldap_pvt_thread_initialize LDAP_P(( void ));
#define LDAP_PVT_THREAD_CREATE_JOINABLE 0
#define LDAP_PVT_THREAD_CREATE_DETACHED 1
+#ifndef LDAP_PVT_THREAD_H_DONE
+#define LDAP_PVT_THREAD_SET_STACK_SIZE
#ifndef LDAP_PVT_THREAD_STACK_SIZE
- /* LARGE stack */
-#define LDAP_PVT_THREAD_STACK_SIZE (4*1024*1024)
+ /* LARGE stack. Will be twice as large on 64 bit machine. */
+#define LDAP_PVT_THREAD_STACK_SIZE ( 1 * 1024 * 1024 * sizeof(void *) )
+/* May be explicitly defined to zero to disable it */
+#elif LDAP_PVT_THREAD_STACK_SIZE == 0
+#undef LDAP_PVT_THREAD_SET_STACK_SIZE
#endif
+#endif /* !LDAP_PVT_THREAD_H_DONE */
LDAP_F( int )
ldap_pvt_thread_create LDAP_P((
LDAP_F( ldap_pvt_thread_t )
ldap_pvt_thread_self LDAP_P(( void ));
-#ifndef LDAP_THREAD_HAVE_RDWR
-typedef struct ldap_int_thread_rdwr_s * ldap_pvt_thread_rdwr_t;
-#endif
-
LDAP_F( int )
ldap_pvt_thread_rdwr_init LDAP_P((ldap_pvt_thread_rdwr_t *rdwrp));
#define LDAP_PVT_THREAD_EINVAL EINVAL
#define LDAP_PVT_THREAD_EBUSY EINVAL
+#ifndef LDAP_PVT_THREAD_H_DONE
typedef ldap_int_thread_pool_t ldap_pvt_thread_pool_t;
typedef void * (ldap_pvt_thread_start_t) LDAP_P((void *ctx, void *arg));
typedef void (ldap_pvt_thread_pool_keyfree_t) LDAP_P((void *key, void *data));
+#endif /* !LDAP_PVT_THREAD_H_DONE */
LDAP_F( int )
ldap_pvt_thread_pool_init LDAP_P((
ldap_pvt_thread_pool_backload LDAP_P((
ldap_pvt_thread_pool_t *pool ));
+LDAP_F( int )
+ldap_pvt_thread_pool_pause LDAP_P((
+ ldap_pvt_thread_pool_t *pool ));
+
+LDAP_F( int )
+ldap_pvt_thread_pool_resume LDAP_P((
+ ldap_pvt_thread_pool_t *pool ));
+
LDAP_F( int )
ldap_pvt_thread_pool_destroy LDAP_P((
ldap_pvt_thread_pool_t *pool,
void *data,
ldap_pvt_thread_pool_keyfree_t *kfree ));
+LDAP_F( void )
+ldap_pvt_thread_pool_purgekey LDAP_P(( void *key ));
+
LDAP_F( void *)
ldap_pvt_thread_pool_context LDAP_P(( void ));
+LDAP_F( void )
+ldap_pvt_thread_pool_context_reset LDAP_P(( void *key ));
+
LDAP_END_DECL
+#define LDAP_PVT_THREAD_H_DONE
#endif /* _LDAP_THREAD_H */