From: moonlightsh <85744700@qq.com> Date: Fri, 16 Jul 2021 02:21:06 +0000 (+0800) Subject: fix evthread_use_pthreads_with_flags dead lock when first return X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c29f1dbe116c88434e77721ca215b8d2082b247f;p=libevent fix evthread_use_pthreads_with_flags dead lock when first return --- diff --git a/evthread_pthread.c b/evthread_pthread.c index 0614a066..00018d4a 100644 --- a/evthread_pthread.c +++ b/evthread_pthread.c @@ -215,6 +215,7 @@ evthread_use_pthreads_with_flags(int flags) evthread_set_id_callback(evthread_posix_get_id); once_init = 1; + pthread_mutex_unlock(&once_init_lock); return 0; error: pthread_mutex_unlock(&once_init_lock);