summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-04-25 03:50:00 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-04-25 03:50:00 +0000
commitabcbd7ea38f64f942a934ba065aabf9da81a21bc (patch)
tree8bf33e560f4c99904d36a1f0681bf5c2ebd34dae /thread.c
parent354844be45efe799031b1a9799e8c6d52cc6b16d (diff)
downloadruby-abcbd7ea38f64f942a934ba065aabf9da81a21bc.tar.gz
* yarvcore.h: remove rb_control_frame_t#callee_id.
* vm_macro.def: ditto. * eval_intern.h (exec_event_hooks): fix to check event flags * eval_intern.h (EXEC_EVENT_HOOK): fix to re-check event flags. * ext/probeprofiler : added. this profiler is sampling based profiler. * vm.c: add rb_thread_current_status() API for probeprofiler. * thread.c (rb_thread_execute_interrupts): add comments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12213 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/thread.c b/thread.c
index bcff909484..5e8c915aa6 100644
--- a/thread.c
+++ b/thread.c
@@ -717,6 +717,7 @@ rb_thread_execute_interrupts(rb_thread_t *th)
/* thread pass */
rb_thread_schedule();
}
+ EXEC_EVENT_HOOK(th, RUBY_EVENT_SWITCH, th->cfp->self, 0, 0);
}
@@ -1836,14 +1837,28 @@ static void
timer_thread_function(void)
{
rb_vm_t *vm = GET_VM(); /* TODO: fix me for Multi-VM */
+
+ /* for time slice */
vm->running_thread->interrupt_flag = 1;
-
+
+ /* check signal */
if (vm->bufferd_signal_size && vm->main_thread->exec_signal == 0) {
vm->main_thread->exec_signal = rb_get_next_signal(vm);
thread_debug("bufferd_signal_size: %d, sig: %d\n",
vm->bufferd_signal_size, vm->main_thread->exec_signal);
rb_thread_interrupt(vm->main_thread);
}
+
+#if 0
+ /* prove profiler */
+ if (vm->prove_profile.enable) {
+ rb_thread_t *th = vm->running_thread;
+
+ if (vm->during_gc) {
+ /* GC prove profiling */
+ }
+ }
+#endif
}
void