From 771a131b0deb926d1ba94ea23c3e1f91eaa3d0ba Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Fri, 31 May 2002 20:22:44 +0000 Subject: [PATCH] Fix unprotected list modification --- libraries/libldap_r/tpool.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libraries/libldap_r/tpool.c b/libraries/libldap_r/tpool.c index 923a1b9ce4..d48a8e9370 100644 --- a/libraries/libldap_r/tpool.c +++ b/libraries/libldap_r/tpool.c @@ -399,7 +399,11 @@ ldap_int_thread_pool_wrapper ( ldap_pvt_thread_mutex_unlock(&pool->ltp_mutex); (ctx->ltc_start_routine)(ctx->ltc_arg); + + ldap_pvt_thread_mutex_lock(&pool->ltp_mutex); LDAP_SLIST_INSERT_HEAD(&pool->ltp_free_list, ctx, ltc_next.l); + ldap_pvt_thread_mutex_unlock(&pool->ltp_mutex); + ldap_pvt_thread_yield(); /* if we use an idle timer, here's -- 2.39.5