[前][次][番号順一覧][スレッド一覧]

ruby-changes:50360

From: normal <ko1@a...>
Date: Mon, 19 Feb 2018 08:58:39 +0900 (JST)
Subject: [ruby-changes:50360] normal:r62476 (trunk): thread_pthread.c (thread cache): destroy cond after unlock

normal	2018-02-19 08:58:35 +0900 (Mon, 19 Feb 2018)

  New Revision: 62476

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62476

  Log:
    thread_pthread.c (thread cache): destroy cond after unlock
    
    No need to hold a lock while destroying a condition variable.

  Modified files:
    trunk/thread_pthread.c
Index: thread_pthread.c
===================================================================
--- thread_pthread.c	(revision 62475)
+++ thread_pthread.c	(revision 62476)
@@ -913,11 +913,11 @@ register_cached_thread_and_wait(rb_nativ https://github.com/ruby/ruby/blob/trunk/thread_pthread.c#L913
         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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]