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

ruby-changes:25898

From: kosaki <ko1@a...>
Date: Thu, 29 Nov 2012 07:03:31 +0900 (JST)
Subject: [ruby-changes:25898] kosaki:r37956 (trunk): * thread.c (thread_start_func_2): small cleanups.

kosaki	2012-11-29 06:55:26 +0900 (Thu, 29 Nov 2012)

  New Revision: 37956

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

  Log:
    * thread.c (thread_start_func_2): small cleanups.

  Modified files:
    trunk/ChangeLog
    trunk/thread.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 37955)
+++ ChangeLog	(revision 37956)
@@ -1,3 +1,7 @@
+Thu Nov 29 06:46:33 2012  KOSAKI Motohiro  <kosaki.motohiro@g...>
+
+	* thread.c (thread_start_func_2): small cleanups.
+
 Thu Nov 29 06:37:08 2012  KOSAKI Motohiro  <kosaki.motohiro@g...>
 
 	* thread.c (thread_start_func_2): remove unused code.
Index: thread.c
===================================================================
--- thread.c	(revision 37955)
+++ thread.c	(revision 37956)
@@ -500,6 +500,7 @@
 	    }
 	    th->value = Qnil;
 	}
+	TH_POP_TAG();
 
 	th->status = THREAD_KILLED;
 	thread_debug("thread end: %p\n", (void *)th);
@@ -509,14 +510,7 @@
 	    /* 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()) {
@@ -524,6 +518,14 @@
 	    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) {
@@ -536,9 +538,6 @@
 	    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/

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