From: Howard Chu Date: Thu, 4 Mar 2004 15:35:29 +0000 (+0000) Subject: ITS#2997 change MAXTHREADS to LDAP_MAXTHR X-Git-Tag: OPENLDAP_REL_ENG_2_2_BP~376 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f3f78e8a1f4b754a755e37da2c79b2ff10bbb6f5;p=openldap ITS#2997 change MAXTHREADS to LDAP_MAXTHR --- diff --git a/libraries/libldap_r/tpool.c b/libraries/libldap_r/tpool.c index 5097ab9c92..9422b4310e 100644 --- a/libraries/libldap_r/tpool.c +++ b/libraries/libldap_r/tpool.c @@ -45,7 +45,7 @@ typedef struct ldap_int_thread_key_s { * We don't expect to use many... */ #define MAXKEYS 32 -#define MAXTHREADS 1024 /* must be a power of 2 */ +#define LDAP_MAXTHR 1024 /* must be a power of 2 */ static ldap_pvt_thread_t tid_zero; @@ -57,7 +57,7 @@ static ldap_pvt_thread_t tid_zero; static struct { ldap_pvt_thread_t id; ldap_int_thread_key_t *ctx; -} thread_keys[MAXTHREADS]; +} thread_keys[LDAP_MAXTHR]; typedef struct ldap_int_thread_ctx_s { @@ -256,13 +256,13 @@ ldap_pvt_thread_pool_submit ( pool->ltp_starting--; /* assign this thread ID to a key slot; start - * at the thread ID itself (mod MAXTHREADS) and + * at the thread ID itself (mod LDAP_MAXTHR) and * look for an empty slot. */ TID_HASH(thr, hash); - for (rc = hash & (MAXTHREADS-1); + for (rc = hash & (LDAP_MAXTHR-1); !TID_EQ(thread_keys[rc].id, tid_zero); - rc = (rc+1) & (MAXTHREADS-1)); + rc = (rc+1) & (LDAP_MAXTHR-1)); thread_keys[rc].id = thr; } else { /* couldn't create thread. back out of @@ -420,8 +420,8 @@ ldap_int_thread_pool_wrapper ( /* store pointer to our keys */ TID_HASH(tid, hash); - for (i = hash & (MAXTHREADS-1); !TID_EQ(thread_keys[i].id, tid); - i = (i+1) & (MAXTHREADS-1)); + for (i = hash & (LDAP_MAXTHR-1); !TID_EQ(thread_keys[i].id, tid); + i = (i+1) & (LDAP_MAXTHR-1)); thread_keys[i].ctx = ltc_key; keyslot = i; @@ -557,8 +557,8 @@ void *ldap_pvt_thread_pool_context( ) tid = ldap_pvt_thread_self(); TID_HASH( tid, hash ); - for (i = hash & (MAXTHREADS-1); !TID_EQ(thread_keys[i].id, tid_zero) && - !TID_EQ(thread_keys[i].id, tid); i = (i+1) & (MAXTHREADS-1)); + for (i = hash & (LDAP_MAXTHR-1); !TID_EQ(thread_keys[i].id, tid_zero) && + !TID_EQ(thread_keys[i].id, tid); i = (i+1) & (LDAP_MAXTHR-1)); return thread_keys[i].ctx; }