From: Motohiro KOSAKI Date: 2011-01-18T14:05:12+09:00 Subject: [ruby-core:34549] [Ruby 1.9-Bug#4285] Ruby don't have asynchrounous exception safe syntax and It should have. Issue #4285 has been updated by Motohiro KOSAKI. Endoh-san, Grr, my fault. I thought Thread.join call pthread_join, but it doesn't. So right you are, thread variable leak doesn't cause serious error. But generically, Asynchrounous exception during OS resource handler class construction is still dangerous. new example is here. def foo begin f = open("example-file") ensure f.close end timeout (1) { foo } if assignment of f was lost, we have no way to close f. So, I agree that reimplementation by C doesn't solve anything. because source of problem is not in timeout.rb, is in asynchrounous exception semantics! So, we don't need anything at 1.9.x timeframe. but I still propose language enhancemnet for any async exception for 2.0. Mathias, Good question! Your proposal solve almost async execption problem. But please imazine nested timeout (maybe it can occur when a library use timeout internally) or Ctrl-C. In other words, mutex is effective only when exception source is recognized. But generically, async exception source are not. ---------------------------------------- http://redmine.ruby-lang.org/issues/show/4285 ---------------------------------------- http://redmine.ruby-lang.org