summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-15 13:21:24 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-15 13:21:24 +0000
commita3071ea4e38eeccc4d7e7eba3394ef7483b3cbcc (patch)
treeef4266fe483b8dd0eaf2de63f72b89d6c7eb3e4c /thread.c
parent25d56ea7b7b52dc81af30c92a9a0e2d2dab6ff27 (diff)
remove rb_thread_t::event_hooks.
* vm_core.h (rb_thread_t): remove rb_thread_t::event_hooks. * vm_trace.c: all hooks are connected to vm->event_hooks and add rb_event_hook_t::filter::th to filter invoke thread. It will simplify invoking hooks code. * thread.c (thread_start_func_2): clear thread specific trace_func. * test/ruby/test_settracefunc.rb: add a test for Thread#add_trace_func. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60776 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/thread.c b/thread.c
index 912462e211..ac887d037d 100644
--- a/thread.c
+++ b/thread.c
@@ -600,6 +600,8 @@ thread_do_start(rb_thread_t *th, VALUE args)
}
}
+void rb_ec_clear_current_thread_trace_func(const rb_execution_context_t *ec);
+
static int
thread_start_func_2(rb_thread_t *th, VALUE *stack_start, VALUE *register_stack_start)
{
@@ -673,6 +675,8 @@ thread_start_func_2(rb_thread_t *th, VALUE *stack_start, VALUE *register_stack_s
}
EC_POP_TAG();
+ rb_ec_clear_current_thread_trace_func(th->ec);
+
/* locking_mutex must be Qfalse */
if (th->locking_mutex != Qfalse) {
rb_bug("thread_start_func_2: locking_mutex must not be set (%p:%"PRIxVALUE")",