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

ruby-changes:25767

From: kosaki <ko1@a...>
Date: Sat, 24 Nov 2012 11:00:26 +0900 (JST)
Subject: [ruby-changes:25767] kosaki:r37824 (trunk): * thread.c (thread_create_core): don't use th->thread_id before

kosaki	2012-11-24 11:00:10 +0900 (Sat, 24 Nov 2012)

  New Revision: 37824

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

  Log:
    * thread.c (thread_create_core): don't use th->thread_id before
      initialized.

  Modified files:
    trunk/ChangeLog
    trunk/thread.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 37823)
+++ ChangeLog	(revision 37824)
@@ -1,3 +1,8 @@
+Sat Nov 24 10:59:14 2012  KOSAKI Motohiro  <kosaki.motohiro@g...>
+
+	* thread.c (thread_create_core): don't use th->thread_id before
+	  initialized.
+
 Sat Nov 24 00:00:53 2012  Nobuyoshi Nakada  <nobu@r...>
 
 	* ruby.c (proc_options, process_options, ruby_process_options): take
Index: thread.c
===================================================================
--- thread.c	(revision 37823)
+++ thread.c	(revision 37824)
@@ -570,13 +570,12 @@
     native_mutex_initialize(&th->interrupt_lock);
 
     /* kick thread */
-    st_insert(th->vm->living_threads, thval, (st_data_t) th->thread_id);
     err = native_thread_create(th);
     if (err) {
-	st_delete_wrap(th->vm->living_threads, th->self);
 	th->status = THREAD_KILLED;
 	rb_raise(rb_eThreadError, "can't create Thread (%d)", err);
     }
+    st_insert(th->vm->living_threads, thval, (st_data_t) th->thread_id);
     return thval;
 }
 

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

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