diff options
author | Koichi Sasada <ko1@atdot.net> | 2020-12-07 16:01:35 +0900 |
---|---|---|
committer | Koichi Sasada <ko1@atdot.net> | 2020-12-07 16:01:35 +0900 |
commit | c2fa024e0220aca6e2437e56df2abf1a2368cbdf (patch) | |
tree | bbe108853e83749d2ef4ff16e053c4b9f6bd8d7e /thread.c | |
parent | cc36e499f9403c2e3dd0514fc8f13ff485c10b82 (diff) |
fix Thread's interrupt and Ractor#take issue
Thread's interrupt set Ractor's wakeup_status as interrupted, but
the status remains next Ractor communication API. This patch makes
to ignore the previous interrupt state.
[Bug #17366]
Also this patch solves the Thread#kill and Ractor#take issues.
Diffstat (limited to 'thread.c')
-rw-r--r-- | thread.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -825,6 +825,9 @@ thread_start_func_2(rb_thread_t *th, VALUE *stack_start) errinfo = th->ec->errinfo; if (state == TAG_FATAL) { + if (th->invoke_type == thread_invoke_type_ractor_proc) { + rb_ractor_atexit(th->ec, Qnil); + } /* fatal error within this thread, need to stop whole script */ } else if (rb_obj_is_kind_of(errinfo, rb_eSystemExit)) { |