aboutsummaryrefslogtreecommitdiffstats
path: root/thread.c
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2020-12-07 16:01:35 +0900
committerKoichi Sasada <ko1@atdot.net>2020-12-07 16:01:35 +0900
commitc2fa024e0220aca6e2437e56df2abf1a2368cbdf (patch)
treebbe108853e83749d2ef4ff16e053c4b9f6bd8d7e /thread.c
parentcc36e499f9403c2e3dd0514fc8f13ff485c10b82 (diff)
downloadruby-c2fa024e0220aca6e2437e56df2abf1a2368cbdf.tar.gz
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.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/thread.c b/thread.c
index 7fcbf9d67b..e910615b84 100644
--- a/thread.c
+++ b/thread.c
@@ -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)) {