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

ruby-changes:18251

From: kosaki <ko1@a...>
Date: Tue, 21 Dec 2010 00:22:16 +0900 (JST)
Subject: [ruby-changes:18251] Ruby:r30274 (trunk): * thread.c (thread_cleanup_func): Moved interrupted_lock

kosaki	2010-12-21 00:20:17 +0900 (Tue, 21 Dec 2010)

  New Revision: 30274

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=30274

  Log:
    * thread.c (thread_cleanup_func): Moved interrupted_lock
              destroying code from native_thread_destroy() to
              thread_cleanup_func() because it's platform independent logic.
    
            * thread_win32.c (native_thread_destroy): ditto.
            * thread_pthread.c (native_thread_destroy): ditto.

  Modified files:
    trunk/ChangeLog
    trunk/thread.c
    trunk/thread_pthread.c
    trunk/thread_win32.c

Index: thread_win32.c
===================================================================
--- thread_win32.c	(revision 30273)
+++ thread_win32.c	(revision 30274)
@@ -511,7 +511,6 @@
 native_thread_destroy(rb_thread_t *th)
 {
     HANDLE intr = InterlockedExchangePointer(&th->native_thread_data.interrupt_event, 0);
-    native_mutex_destroy(&th->interrupt_lock);
     thread_debug("close handle - intr: %p, thid: %p\n", intr, th->thread_id);
     w32_close_handle(intr);
 }
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 30273)
+++ ChangeLog	(revision 30274)
@@ -1,3 +1,12 @@
+Tue Dec 21 00:59:40 2010  KOSAKI Motohiro  <kosaki.motohiro@g...>
+
+	* thread.c (thread_cleanup_func): Moved interrupted_lock
+	  destroying code from native_thread_destroy() to
+	  thread_cleanup_func() because it's platform independent logic.
+
+	* thread_win32.c (native_thread_destroy): ditto.
+	* thread_pthread.c (native_thread_destroy): ditto.
+
 Tue Dec 21 00:46:20 2010  KOSAKI Motohiro  <kosaki.motohiro@g...>
 
 	* thread.c (thread_cleanup_func): Don't touch native threading
Index: thread_pthread.c
===================================================================
--- thread_pthread.c	(revision 30273)
+++ thread_pthread.c	(revision 30274)
@@ -339,7 +339,6 @@
 static void
 native_thread_destroy(rb_thread_t *th)
 {
-    pthread_mutex_destroy(&th->interrupt_lock);
     pthread_cond_destroy(&th->native_thread_data.gvl_cond);
     pthread_cond_destroy(&th->native_thread_data.sleep_cond);
 }
Index: thread.c
===================================================================
--- thread.c	(revision 30273)
+++ thread.c	(revision 30274)
@@ -406,6 +406,7 @@
     if (atfork)
 	return;
 
+    native_mutex_destroy(&th->interrupt_lock);
     native_thread_destroy(th);
 }
 

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

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