From bff57efca187bcdb4b183229cb913a55da6d9cf5 Mon Sep 17 00:00:00 2001 From: normal Date: Sun, 18 Feb 2018 23:58:35 +0000 Subject: [PATCH] thread_pthread.c (thread cache): destroy cond after unlock No need to hold a lock while destroying a condition variable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62476 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- thread_pthread.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/thread_pthread.c b/thread_pthread.c index db304ba276..5e65e133f7 100644 --- a/thread_pthread.c +++ b/thread_pthread.c @@ -913,11 +913,11 @@ register_cached_thread_and_wait(rb_nativethread_id_t thread_self_id) if (entry.th == NULL) { /* unused */ list_del(&entry.node); } - - rb_native_cond_destroy(&entry.cond); } rb_native_mutex_unlock(&thread_cache_lock); + rb_native_cond_destroy(&entry.cond); + return entry.th; } #else