summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authorkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-28 04:43:15 +0000
committerkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-28 04:43:15 +0000
commit8111b32d685278de68e9eefe273524cf1266cff0 (patch)
tree64b27eb1db284fc800c10e8edacec3df404b50fb /thread.c
parentd5c463b5767c5bc57d79ba43a38edc3f3ad304b2 (diff)
* 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37921 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/thread.c b/thread.c
index 473713f862..b57e539444 100644
--- a/thread.c
+++ b/thread.c
@@ -378,8 +378,6 @@ rb_thread_terminate_all(void)
/* 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 @@ thread_s_new(int argc, VALUE *argv, VALUE klass)
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);