summaryrefslogtreecommitdiff
path: root/thread_pthread.c
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-02-18 23:58:35 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-02-18 23:58:35 +0000
commitbff57efca187bcdb4b183229cb913a55da6d9cf5 (patch)
tree1239a79ff3f86533747860f47463cf0b16b3d1ce /thread_pthread.c
parent7a8460ed5a766cad8c95e209c888f0c48adb1b2a (diff)
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
Diffstat (limited to 'thread_pthread.c')
-rw-r--r--thread_pthread.c4
1 files 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