aboutsummaryrefslogtreecommitdiffstats
path: root/cont.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-21 09:51:01 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-21 09:51:01 +0000
commit3af5298e8cc9d88fb0c763fb623b722a97912877 (patch)
treefbb8dec418361bb348a7f153e9309873b73afab7 /cont.c
parent416aa4591859f20ba4c86a139c4855f1c8ea56f1 (diff)
downloadruby-3af5298e8cc9d88fb0c763fb623b722a97912877.tar.gz
* include/ruby/ruby.h, cont.c, vm_trace.c: add a new event
fiber_switch. We need more discussion about this feature so that I don't write it on NEWS. [Feature #11348] * test/ruby/test_settracefunc.rb: add tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'cont.c')
-rw-r--r--cont.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/cont.c b/cont.c
index fc0cf53655..774a026bd5 100644
--- a/cont.c
+++ b/cont.c
@@ -1260,8 +1260,9 @@ rb_fiber_start(void)
th->errinfo = Qnil;
th->root_lep = rb_vm_ep_local_ep(proc->block.ep);
th->root_svar = Qfalse;
-
fib->status = RUNNING;
+
+ EXEC_EVENT_HOOK(th, RUBY_EVENT_FIBER_SWITCH, th->self, 0, 0, Qnil);
cont->value = rb_vm_invoke_proc(th, proc, argc, argv, 0);
}
TH_POP_TAG();
@@ -1451,6 +1452,8 @@ fiber_switch(rb_fiber_t *fib, int argc, const VALUE *argv, int is_resume)
value = fiber_store(fib, th);
RUBY_VM_CHECK_INTS(th);
+ EXEC_EVENT_HOOK(th, RUBY_EVENT_FIBER_SWITCH, th->self, 0, 0, Qnil);
+
return value;
}