diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-02-18 23:58:35 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-02-18 23:58:35 +0000 |
commit | bff57efca187bcdb4b183229cb913a55da6d9cf5 (patch) | |
tree | 1239a79ff3f86533747860f47463cf0b16b3d1ce /thread_pthread.c | |
parent | 7a8460ed5a766cad8c95e209c888f0c48adb1b2a (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.c | 4 |
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 |