From: Motohiro KOSAKI Date: 2011-01-12T15:18:15+09:00 Subject: [ruby-core:34410] [Ruby 1.9-Bug#4266] Timeouts in threads cause "ThreadError: deadlock; recursive locking" Issue #4266 has been updated by Motohiro KOSAKI. That said, our Mutex.synchronize() method has two unsafe point. ----------------------------------------------------------------- def synchronize self.lock // (1) begin yield ensure // (2) self.unlock rescue nil end end ----------------------------------------------------------------- If the mutex got thread#raise at (1), it doesn't call unlock because it haven't entered -begin- block. And if got at (2), it also doesn't call unlock because we are no longer in -begin- block. My patch fixed only (1). Thanks. ---------------------------------------- http://redmine.ruby-lang.org/issues/show/4266 ---------------------------------------- http://redmine.ruby-lang.org