Skip to content

Wait for Fiber#kill to finish the killed fiber - #10100

Open
sampokuokkanen wants to merge 1 commit into
jruby:masterfrom
sampokuokkanen:fiber-kill-wait
Open

sampokuokkanen wants to merge 1 commit into
jruby:masterfrom
sampokuokkanen:fiber-kill-wait

Conversation

@sampokuokkanen

Copy link
Copy Markdown
Contributor

Fiber#kill pushed the kill onto a suspended fiber's queue and returned right away, so the fiber's ensure blocks were still running on its own thread when the caller went on.

Like MRI's fiber_raise, switch into the fiber the same way Fiber#raise does and wait until it hands control back. An unborn fiber is handed the kill with us as its resumer, so it is dead when kill returns.

Fiber#kill pushed the kill onto a suspended fiber's queue and returned
right away, so the fiber's ensure blocks were still running on its own
thread when the caller went on.

Like MRI's fiber_raise, switch into the fiber the same way Fiber#raise
does and wait until it hands control back. An unborn fiber is handed the
kill with us as its resumer, so it is dead when kill returns.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant