]> git.sur5r.net Git - openldap/commit
Protect thread_keys[] with ldap_pvt_thread_pool_mutex, except in
authorHallvard Furuseth <hallvard@openldap.org>
Wed, 9 May 2007 21:38:28 +0000 (21:38 +0000)
committerHallvard Furuseth <hallvard@openldap.org>
Wed, 9 May 2007 21:38:28 +0000 (21:38 +0000)
commit8a92825225d8889e3400c086e21440ef1e17cc58
tree44eec84850c3afedc1ee2083886cb452b52007e9
parent92afeb8ef73f7281248ef11bca23839bdcf0bb64
Protect thread_keys[] with ldap_pvt_thread_pool_mutex, except in
ldap_pvt_thread_pool_purgekey() which may only be called during pauses.

Thus, also wait for pauses to finish before accessing thread_keys in
ldap_int_thread_pool_wrapper().  This may prevent pending tasks from
being started when a pause had been requested, which seems to have been
possible.  If that was a feature, we can split ltp_pause==1 in 2 states:
in pause (causes wait), and pause requested.

Also move 'thread_keys[].id = <thread id>' from pool_submit to
pool_wrapper.  Until pool_wrapper set the ctx as well, thread context
lookup would just return NULL anyway.
libraries/libldap_r/tpool.c