summaryrefslogtreecommitdiff
path: root/vm_trace.c
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-28 01:48:11 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-28 01:48:11 +0000
commit11422497134555d738e34f1d9d6c7fcc98a0f592 (patch)
treed077061d5aa51495ed0a70e735d0f0a4e5446d8b /vm_trace.c
parente303785dde0bfbb89979dc97a755c6be5fce71fe (diff)
vm.c: remove rb_vm_living_threads_foreach function
Shorter code with fewer callbacks and casts should be more readable. * vm.c (rb_vm_living_threads_foreach): remove function [ruby-core:62745] * thread.c (terminate_i): remove * thread.c (terminate_all): implement (inlines old terminate_i) * thread.c (rb_thread_terminate_all): use terminate_all * thread.c (rb_thread_fd_close_i): remove * thread.c (rb_thread_fd_close): iterate inline * thread.c (thread_list_i): remove * thread.c (rb_thread_list): iterate inline * thread.c (rb_thread_atfork_internal): iterate inline * thread.c (terminate_atfork_i): update types to remove casts * thread.c (terminate_atfork_before_exec_i): ditto * thread.c (struct thgroup_list_params): remove definition * thread.c (thgroup_list_i): remove * thread.c (thgroup_list): iterate inline * thread.c (check_deadlock_i): remove * thread.c (debug_deadlock_check): implement (inlines check_deadlock_i) * thread.c (debug_i): remove * thread.c (rb_check_deadlock): iterate inline * vm.c (vm_mark_each_thread_func): remove * vm.c (rb_vm_mark): iterate inline * vm_core.h (rb_vm_living_threads_remove): remove * vm_trace.c (clear_trace_func_i): remove * vm_trace.c (rb_clear_trace_func): iterate inline git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_trace.c')
-rw-r--r--vm_trace.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/vm_trace.c b/vm_trace.c
index dd1a082..678b819 100644
--- a/vm_trace.c
+++ b/vm_trace.c
@@ -212,17 +212,15 @@ rb_remove_event_hook_with_data(rb_event_hook_func_t func, VALUE data)
return remove_event_hook(&GET_VM()->event_hooks, func, data);
}
-static int
-clear_trace_func_i(rb_thread_t *th, void *unused)
-{
- rb_threadptr_remove_event_hook(th, 0, Qundef);
- return ST_CONTINUE;
-}
-
void
rb_clear_trace_func(void)
{
- rb_vm_living_threads_foreach(GET_VM(), clear_trace_func_i, 0);
+ rb_vm_t *vm = GET_VM();
+ rb_thread_t *th;
+
+ list_for_each(&vm->living_threads, th, vmlt_node) {
+ rb_threadptr_remove_event_hook(th, 0, Qundef);
+ }
rb_remove_event_hook(0);
}