diff options
author | Koichi Sasada <ko1@atdot.net> | 2020-12-19 06:38:58 +0900 |
---|---|---|
committer | Koichi Sasada <ko1@atdot.net> | 2020-12-22 00:03:00 +0900 |
commit | a2950369bd8a5866092f6badf59b0811653a6092 (patch) | |
tree | b8933f0f3f87618c04290e420222daef3a63e68d /ractor.c | |
parent | c7a5cc2c3098ea74343a0dbab36b3a65bc7a4144 (diff) |
TracePoint.new(&block) should be ractor-local
TracePoint should be ractor-local because the Proc can violate the
Ractor-safe.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3943
Diffstat (limited to 'ractor.c')
-rw-r--r-- | ractor.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -197,6 +197,7 @@ ractor_mark(void *ptr) rb_gc_mark(r->r_stdin); rb_gc_mark(r->r_stdout); rb_gc_mark(r->r_stderr); + rb_hook_list_mark(&r->event_hooks); if (r->threads.cnt > 0) { rb_thread_t *th = 0; @@ -230,6 +231,7 @@ ractor_free(void *ptr) ractor_queue_free(&r->sync.incoming_queue); ractor_waiting_list_free(&r->sync.taking_ractors); ractor_local_storage_free(r); + rb_hook_list_free(&r->event_hooks); ruby_xfree(r); } @@ -2126,6 +2128,12 @@ rb_ractor_stderr_set(VALUE err) } } +rb_hook_list_t * +rb_ractor_hooks(rb_ractor_t *cr) +{ + return &cr->event_hooks; +} + /// traverse function // 2: stop search |