]> git.sur5r.net Git - openldap/commitdiff
Fix unprotected list modification
authorKurt Zeilenga <kurt@openldap.org>
Fri, 31 May 2002 20:22:44 +0000 (20:22 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Fri, 31 May 2002 20:22:44 +0000 (20:22 +0000)
libraries/libldap_r/tpool.c

index 923a1b9ce4e23c94e543c87b1e8fab17288e8744..d48a8e9370da48f0a852abc627dc43eb71fc7f96 100644 (file)
@@ -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