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

ruby-changes:25864

From: kosaki <ko1@a...>
Date: Wed, 28 Nov 2012 13:43:53 +0900 (JST)
Subject: [ruby-changes:25864] kosaki:r37921 (trunk): * thread.c (thread_s_new): uses main_thread->status instead of

kosaki	2012-11-28 13:43:15 +0900 (Wed, 28 Nov 2012)

  New Revision: 37921

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

  Log:
    * thread.c (thread_s_new): uses main_thread->status instead of
      th->inhibit_thread_creation for preventing thread creation.
    * vm_core.h (rb_vm_struct): remove inhibit_thread_creation field.
    * thread.c (rb_thread_terminate_all): ditto.

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

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 37920)
+++ ChangeLog	(revision 37921)
@@ -1,3 +1,10 @@
+Wed Nov 28 13:39:54 2012  KOSAKI Motohiro  <kosaki.motohiro@g...>
+
+	* thread.c (thread_s_new): uses main_thread->status instead of
+	  th->inhibit_thread_creation for preventing thread creation.
+	* vm_core.h (rb_vm_struct): remove inhibit_thread_creation field.
+	* thread.c (rb_thread_terminate_all): ditto.
+
 Wed Nov 28 13:27:29 2012  Aaron Patterson <aaron@t...>
 
 	* ext/psych/extconf.rb: use embedded libyaml if no system libyaml is
Index: vm_core.h
===================================================================
--- vm_core.h	(revision 37920)
+++ vm_core.h	(revision 37921)
@@ -341,7 +341,6 @@
     VALUE thgroup_default;
 
     int running;
-    int inhibit_thread_creation;
     int thread_abort_on_exception;
     int trace_running;
     volatile int sleeper;
Index: thread.c
===================================================================
--- thread.c	(revision 37920)
+++ thread.c	(revision 37921)
@@ -378,8 +378,6 @@
     /* unlock all locking mutexes */
     rb_threadptr_unlock_all_locking_mutexes(th);
 
-    vm->inhibit_thread_creation = 1;
-
   retry:
     thread_debug("rb_thread_terminate_all (main thread: %p)\n", (void *)th);
     st_foreach(vm->living_threads, terminate_i, (st_data_t)th);
@@ -611,7 +609,7 @@
     rb_thread_t *th;
     VALUE thread = rb_thread_alloc(klass);
 
-    if (GET_VM()->inhibit_thread_creation)
+    if (GET_VM()->main_thread->status == THREAD_KILLED)
 	rb_raise(rb_eThreadError, "can't alloc thread");
 
     rb_obj_call_init(thread, argc, argv);

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

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