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

ruby-changes:25907

From: kosaki <ko1@a...>
Date: Thu, 29 Nov 2012 11:50:21 +0900 (JST)
Subject: [ruby-changes:25907] kosaki:r37964 (trunk): Revert r37956: thread.c (thread_start_func_2): small cleanups.

kosaki	2012-11-29 11:50:11 +0900 (Thu, 29 Nov 2012)

  New Revision: 37964

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

  Log:
    Revert r37956: thread.c (thread_start_func_2): small cleanups.

  Modified files:
    trunk/thread.c

Index: thread.c
===================================================================
--- thread.c	(revision 37963)
+++ thread.c	(revision 37964)
@@ -507,7 +507,6 @@
 	    }
 	    th->value = Qnil;
 	}
-	TH_POP_TAG();
 
 	th->status = THREAD_KILLED;
 	thread_debug("thread end: %p\n", (void *)th);
@@ -517,7 +516,14 @@
 	    /* treat with normal error object */
 	    rb_threadptr_raise(main_th, 1, &errinfo);
 	}
+	TH_POP_TAG();
 
+	/* locking_mutex must be Qfalse */
+	if (th->locking_mutex != Qfalse) {
+	    rb_bug("thread_start_func_2: locking_mutex must not be set (%p:%"PRIxVALUE")",
+		   (void *)th, th->locking_mutex);
+	}
+
 	/* delete self other than main thread from living_threads */
 	st_delete_wrap(th->vm->living_threads, th->self);
 	if (rb_thread_alone()) {
@@ -525,14 +531,6 @@
 	    rb_threadptr_interrupt(main_th);
 	}
 
-	/* locking_mutex must be Qfalse */
-	if (th->locking_mutex != Qfalse) {
-	    rb_bug("thread_start_func_2: locking_mutex must not be set (%p:%"PRIxVALUE")",
-		   (void *)th, th->locking_mutex);
-	}
-	rb_threadptr_unlock_all_locking_mutexes(th);
-	rb_check_deadlock(th->vm);
-
 	/* wake up joining threads */
 	join_list = th->join_list;
 	while (join_list) {
@@ -545,6 +543,9 @@
 	    join_list = join_list->next;
 	}
 
+	rb_threadptr_unlock_all_locking_mutexes(th);
+	rb_check_deadlock(th->vm);
+
 	if (!th->root_fiber) {
 	    rb_thread_recycle_stack_release(th->stack);
 	    th->stack = 0;

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

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