diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-07-13 06:10:26 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-07-13 06:10:26 +0000 |
commit | 4240de3c6dad1e1e2e864ad46b6047fbce0e1859 (patch) | |
tree | d385154d3258557de666376f3ffbb2ce6175b677 /vm_core.h | |
parent | 073598064efc483260ecb17bc66412ba7f9b8062 (diff) |
merges r23959 from trunk into ruby_1_9_1.
--
* thread.c (rb_threadptr_exec_event_hooks): new function to
execute event hooks, with preserving errinfo. [ruby-core:24118]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@24068 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_core.h')
-rw-r--r-- | vm_core.h | 22 |
1 files changed, 3 insertions, 19 deletions
@@ -631,30 +631,14 @@ void rb_thread_execute_interrupts(rb_thread_t *); RUBY_VM_CHECK_INTS_TH(GET_THREAD()) /* tracer */ -static inline void -exec_event_hooks(rb_event_hook_t *hook, rb_event_flag_t flag, VALUE self, ID id, VALUE klass) -{ - if (self == rb_mRubyVMFrozenCore) return; - while (hook) { - if (flag & hook->flag) { - (*hook->func)(flag, hook->data, self, id, klass); - } - hook = hook->next; - } -} +void +rb_threadptr_exec_event_hooks(rb_thread_t *th, rb_event_flag_t flag, VALUE self, ID id, VALUE klass); #define EXEC_EVENT_HOOK(th, flag, self, id, klass) do { \ rb_event_flag_t wait_event__ = th->event_flags; \ if (UNLIKELY(wait_event__)) { \ if (wait_event__ & (flag | RUBY_EVENT_VM)) { \ - VALUE self__ = (self), klass__ = (klass); \ - ID id__ = (id); \ - if (wait_event__ & flag) { \ - 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__); \ - } \ + rb_threadptr_exec_event_hooks(th, flag, self, id, klass); \ } \ } \ } while (0) |