X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;ds=sidebyside;f=include%2Fldap_pvt_thread.h;h=738140fb2fbeb1929cd89956006eb5ccc2d81b54;hb=83967bcda297b65e6f500b9ad234db87dedfcfee;hp=fe8b5beb94d12f9c1a6accb45fb9ca23ae9246ff;hpb=f269301ab97ffe041fc7dc461a9346c31e3b0405;p=openldap diff --git a/include/ldap_pvt_thread.h b/include/ldap_pvt_thread.h index fe8b5beb94..738140fb2f 100644 --- a/include/ldap_pvt_thread.h +++ b/include/ldap_pvt_thread.h @@ -2,7 +2,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * Copyright 1998-2006 The OpenLDAP Foundation. + * Copyright 1998-2009 The OpenLDAP Foundation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -34,13 +34,9 @@ typedef ldap_int_thread_cond_t ldap_pvt_thread_cond_t; typedef ldap_int_thread_rdwr_t ldap_pvt_thread_rdwr_t; #endif typedef ldap_int_thread_rmutex_t ldap_pvt_thread_rmutex_t; +typedef ldap_int_thread_key_t ldap_pvt_thread_key_t; #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 ) @@ -63,12 +59,12 @@ ldap_pvt_thread_set_concurrency LDAP_P(( int )); #ifndef LDAP_PVT_THREAD_H_DONE #define LDAP_PVT_THREAD_SET_STACK_SIZE -#ifndef LDAP_PVT_THREAD_STACK_SIZE +/* The size may be explicitly #defined to zero to disable it. */ +#if defined( LDAP_PVT_THREAD_STACK_SIZE ) && LDAP_PVT_THREAD_STACK_SIZE == 0 +# undef LDAP_PVT_THREAD_SET_STACK_SIZE +#elif !defined( LDAP_PVT_THREAD_STACK_SIZE ) /* 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 +# define LDAP_PVT_THREAD_STACK_SIZE ( 1 * 1024 * 1024 * sizeof(void *) ) #endif #endif /* !LDAP_PVT_THREAD_H_DONE */ @@ -174,6 +170,18 @@ ldap_pvt_thread_rdwr_wtrylock LDAP_P((ldap_pvt_thread_rdwr_t *rdwrp)); LDAP_F( int ) ldap_pvt_thread_rdwr_wunlock LDAP_P((ldap_pvt_thread_rdwr_t *rdwrp)); +LDAP_F( int ) +ldap_pvt_thread_key_create LDAP_P((ldap_pvt_thread_key_t *keyp)); + +LDAP_F( int ) +ldap_pvt_thread_key_destroy LDAP_P((ldap_pvt_thread_key_t key)); + +LDAP_F( int ) +ldap_pvt_thread_key_setdata LDAP_P((ldap_pvt_thread_key_t key, void *data)); + +LDAP_F( int ) +ldap_pvt_thread_key_getdata LDAP_P((ldap_pvt_thread_key_t key, void **data)); + #ifdef LDAP_DEBUG LDAP_F( int ) ldap_pvt_thread_rdwr_readers LDAP_P((ldap_pvt_thread_rdwr_t *rdwrp)); @@ -212,10 +220,41 @@ ldap_pvt_thread_pool_maxthreads LDAP_P(( ldap_pvt_thread_pool_t *pool, int max_threads )); +#ifndef LDAP_PVT_THREAD_H_DONE +typedef enum { + LDAP_PVT_THREAD_POOL_PARAM_UNKNOWN = -1, + LDAP_PVT_THREAD_POOL_PARAM_MAX, + LDAP_PVT_THREAD_POOL_PARAM_MAX_PENDING, + LDAP_PVT_THREAD_POOL_PARAM_OPEN, + LDAP_PVT_THREAD_POOL_PARAM_STARTING, + LDAP_PVT_THREAD_POOL_PARAM_ACTIVE, + LDAP_PVT_THREAD_POOL_PARAM_PAUSING, + LDAP_PVT_THREAD_POOL_PARAM_PENDING, + LDAP_PVT_THREAD_POOL_PARAM_BACKLOAD, + LDAP_PVT_THREAD_POOL_PARAM_ACTIVE_MAX, + LDAP_PVT_THREAD_POOL_PARAM_PENDING_MAX, + LDAP_PVT_THREAD_POOL_PARAM_BACKLOAD_MAX, + LDAP_PVT_THREAD_POOL_PARAM_STATE +} ldap_pvt_thread_pool_param_t; +#endif /* !LDAP_PVT_THREAD_H_DONE */ + +LDAP_F( int ) +ldap_pvt_thread_pool_query LDAP_P(( + ldap_pvt_thread_pool_t *pool, + ldap_pvt_thread_pool_param_t param, void *value )); + +LDAP_F( int ) +ldap_pvt_thread_pool_pausing LDAP_P(( + ldap_pvt_thread_pool_t *pool )); + LDAP_F( int ) ldap_pvt_thread_pool_backload LDAP_P(( ldap_pvt_thread_pool_t *pool )); +LDAP_F( int ) +ldap_pvt_thread_pool_pausecheck LDAP_P(( + ldap_pvt_thread_pool_t *pool )); + LDAP_F( int ) ldap_pvt_thread_pool_pause LDAP_P(( ldap_pvt_thread_pool_t *pool )); @@ -241,7 +280,9 @@ ldap_pvt_thread_pool_setkey LDAP_P(( void *ctx, void *key, void *data, - ldap_pvt_thread_pool_keyfree_t *kfree )); + ldap_pvt_thread_pool_keyfree_t *kfree, + void **olddatap, + ldap_pvt_thread_pool_keyfree_t **oldkfreep )); LDAP_F( void ) ldap_pvt_thread_pool_purgekey LDAP_P(( void *key ));