Permalink
Browse files

Fix newly-introduced Thread#kill deadlock

The following commit introduced another deadlock. Threads MUST be
Rubinius.synchronize-d, but they weren't in Thread#kill.

  ba7667b Correctly implement Thread#kill

Previously, Thread#kill internally used Thread#raise, which had gotten
completely deadlock-free. And there is no problem.

But, the commit made Thread#kill use a primitive for its function. That must be
inside Rubinius.synchronize as was before.
  • Loading branch information...
ryoqun committed Sep 29, 2012
1 parent a69025c commit 3b4ed0fd3dd8dcfddc37722d448b7f42d8f5e73d
Showing with 3 additions and 1 deletion.
  1. +3 −1 kernel/bootstrap/thread19.rb
@@ -101,7 +101,9 @@ def setup(prime_lock)
def kill
@dying = true
@sleep = false
- kill_prim
+ Rubinius.synchronize(self) do
+ kill_prim
+ end
end
alias_method :exit, :kill

0 comments on commit 3b4ed0f

Please sign in to comment.