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

ruby-changes:20398

From: kosaki <ko1@a...>
Date: Fri, 8 Jul 2011 13:40:15 +0900 (JST)
Subject: [ruby-changes:20398] kosaki:r32446 (trunk): * thread.c (thread_unlock_all_locking_mutexes): rename to

kosaki	2011-07-08 13:40:01 +0900 (Fri, 08 Jul 2011)

  New Revision: 32446

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

  Log:
    * thread.c (thread_unlock_all_locking_mutexes): rename to
      rb_threadptr_unlock_all_locking_mutexes and remove static.
    * vm_core.h: add rb_threadptr_unlock_all_locking_mutexes declaration.
    * thread.c (thread_start_func_2): adjust the above rename.
    
    * eval.c (ruby_cleanup): call rb_threadptr_unlock_all_locking_mutexes
      again after finalizer. [Bug #4988] [ruby-dev:44049]

  Modified files:
    trunk/ChangeLog
    trunk/eval.c
    trunk/thread.c
    trunk/vm_core.h

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 32445)
+++ ChangeLog	(revision 32446)
@@ -1,3 +1,13 @@
+Fri Jul  8 13:36:02 2011  KOSAKI Motohiro  <kosaki.motohiro@g...>
+
+	* thread.c (thread_unlock_all_locking_mutexes): rename to
+	  rb_threadptr_unlock_all_locking_mutexes and remove static.
+	* vm_core.h: add rb_threadptr_unlock_all_locking_mutexes declaration.
+	* thread.c (thread_start_func_2): adjust the above rename.
+
+	* eval.c (ruby_cleanup): call rb_threadptr_unlock_all_locking_mutexes
+	  again after finalizer. [Bug #4988] [ruby-dev:44049]
+
 Fri Jul  8 13:06:09 2011  KOSAKI Motohiro  <kosaki.motohiro@g...>
 
 	* cont.c (FIBER_MACHINE_STACK_ALLOCATION_SIZE): Fiber stack size
Index: vm_core.h
===================================================================
--- vm_core.h	(revision 32445)
+++ vm_core.h	(revision 32446)
@@ -702,6 +702,7 @@
 void rb_threadptr_signal_exit(rb_thread_t *th);
 void rb_threadptr_execute_interrupts(rb_thread_t *);
 void rb_threadptr_interrupt(rb_thread_t *th);
+void rb_threadptr_unlock_all_locking_mutexes(rb_thread_t *th);
 
 void rb_thread_lock_unlock(rb_thread_lock_t *);
 void rb_thread_lock_destroy(rb_thread_lock_t *);
Index: thread.c
===================================================================
--- thread.c	(revision 32445)
+++ thread.c	(revision 32446)
@@ -365,8 +365,8 @@
     }
 }
 
-static void
-thread_unlock_all_locking_mutexes(rb_thread_t *th)
+void
+rb_threadptr_unlock_all_locking_mutexes(rb_thread_t *th)
 {
     if (th->keeping_mutexes) {
 	rb_mutex_unlock_all(th->keeping_mutexes, th);
@@ -517,7 +517,7 @@
 	    join_th = join_th->join_list_next;
 	}
 
-	thread_unlock_all_locking_mutexes(th);
+	rb_threadptr_unlock_all_locking_mutexes(th);
 	if (th != main_th) rb_check_deadlock(th->vm);
 
 	if (!th->root_fiber) {
Index: eval.c
===================================================================
--- eval.c	(revision 32445)
+++ eval.c	(revision 32446)
@@ -145,6 +145,9 @@
     th->errinfo = errs[1];
     ex = error_handle(ex);
     ruby_finalize_1();
+
+    /* unlock again if finalizer took mutexes. */
+    rb_threadptr_unlock_all_locking_mutexes(GET_THREAD());
     POP_TAG();
     rb_thread_stop_timer_thread(1);
 

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

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