mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* thread.c (thread_create_core): let new thread inherit RUBY_EVENT_VM
of event_flags. [ruby-core:25191] * thread.c (rb_threadptr_exec_event_hooks): delete RUBY_EVENT_VM if all event_hooks are removed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27033 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
30a4825aea
commit
96ecfe9a57
2 changed files with 17 additions and 1 deletions
|
@ -1,3 +1,11 @@
|
|||
Wed Mar 24 23:43:40 2010 Yusuke Endoh <mame@tsg.ne.jp>
|
||||
|
||||
* thread.c (thread_create_core): let new thread inherit RUBY_EVENT_VM
|
||||
of event_flags. [ruby-core:25191]
|
||||
|
||||
* thread.c (rb_threadptr_exec_event_hooks): delete RUBY_EVENT_VM if
|
||||
all event_hooks are removed.
|
||||
|
||||
Wed Mar 24 22:58:02 2010 Yusuke Endoh <mame@tsg.ne.jp>
|
||||
|
||||
* configure.in: revert the previous commit, which seemed to break make
|
||||
|
|
10
thread.c
10
thread.c
|
@ -549,6 +549,9 @@ thread_create_core(VALUE thval, VALUE args, VALUE (*fn)(ANYARGS))
|
|||
th->thgroup = GET_THREAD()->thgroup;
|
||||
|
||||
native_mutex_initialize(&th->interrupt_lock);
|
||||
if (GET_VM()->event_hooks != NULL)
|
||||
th->event_flags |= RUBY_EVENT_VM;
|
||||
|
||||
/* kick thread */
|
||||
st_insert(th->vm->living_threads, thval, (st_data_t) th->thread_id);
|
||||
err = native_thread_create(th);
|
||||
|
@ -3769,7 +3772,12 @@ rb_threadptr_exec_event_hooks(rb_thread_t *th, rb_event_flag_t flag, VALUE self,
|
|||
exec_event_hooks(th->event_hooks, flag, self, id, klass);
|
||||
}
|
||||
if (wait_event & RUBY_EVENT_VM) {
|
||||
exec_event_hooks(th->vm->event_hooks, flag, self, id, klass);
|
||||
if (th->vm->event_hooks == NULL) {
|
||||
th->event_flags &= (~RUBY_EVENT_VM);
|
||||
}
|
||||
else {
|
||||
exec_event_hooks(th->vm->event_hooks, flag, self, id, klass);
|
||||
}
|
||||
}
|
||||
th->errinfo = errinfo;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue