Actions
Bug #20082
openKilling fibers across threads: unexpected exception
Bug #20082:
Killing fibers across threads: unexpected exception
Description
For providing the example in a changelog, I tried to imitate killing fibers belonging to other threads.
Documentation claims
Raises FiberError if called on a fiber belonging to another thread.
So, I created this artificial example to check how it works:
fibers = []
Thread.new {
f = Fiber.new { (1..).each { sleep(0.1) } }
fibers << f
f.resume
}
sleep(0.1) # to make sure the thread has started
fibers.last.kill
The example indeed fails with FiberError
, but the error message is confusing:
in `kill': attempt to resume a resumed fiber (double resume) (FiberError)
Is this an expected message for such case? Or am I misunderstanding something?
Actions