Fixes the following: ```ruby Thread.new { Fiber.current.kill }.join ```
This commit is contained in:
parent
86eb5f9c05
commit
54ef6c312a
Notes:
git
2025-06-06 00:31:58 +00:00
Merged-By: ioquatix <samuel@codeotaku.com>
@ -37,3 +37,8 @@ assert_normal_exit %q{
|
||||
assert_normal_exit %q{
|
||||
Fiber.new(&Object.method(:class_eval)).resume("foo")
|
||||
}, '[ruby-dev:34128]'
|
||||
|
||||
# [Bug #21400]
|
||||
assert_normal_exit %q{
|
||||
Thread.new { Fiber.current.kill }.join
|
||||
}
|
||||
|
4
thread.c
4
thread.c
@ -1127,6 +1127,10 @@ thread_join(rb_thread_t *target_th, VALUE timeout, rb_hrtime_t *limit)
|
||||
/* OK. killed. */
|
||||
break;
|
||||
default:
|
||||
if (err == RUBY_FATAL_FIBER_KILLED) { // not integer constant so can't be a case expression
|
||||
// root fiber killed in non-main thread
|
||||
break;
|
||||
}
|
||||
rb_bug("thread_join: Fixnum (%d) should not reach here.", FIX2INT(err));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user