mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
d5c463b576
commit
8111b32d68
3 changed files with 8 additions and 4 deletions
|
@ -1,3 +1,10 @@
|
|||
Wed Nov 28 13:39:54 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
||||
|
||||
* 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@tenderlovemaking.com>
|
||||
|
||||
* ext/psych/extconf.rb: use embedded libyaml if no system libyaml is
|
||||
|
|
4
thread.c
4
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);
|
||||
|
|
|
@ -341,7 +341,6 @@ typedef struct rb_vm_struct {
|
|||
VALUE thgroup_default;
|
||||
|
||||
int running;
|
||||
int inhibit_thread_creation;
|
||||
int thread_abort_on_exception;
|
||||
int trace_running;
|
||||
volatile int sleeper;
|
||||
|
|
Loading…
Reference in a new issue