diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/finalize.rb | 2 | ||||
-rw-r--r-- | lib/thread.rb | 13 |
2 files changed, 6 insertions, 9 deletions
diff --git a/lib/finalize.rb b/lib/finalize.rb index 1482e7ae20..e479cac563 100644 --- a/lib/finalize.rb +++ b/lib/finalize.rb @@ -170,7 +170,7 @@ module Finalizer # ObjectSpace#add_finalizer¤Ø¤ÎÅÐÏ¿´Ø¿ô def final_of(id) if assocs = Dependency.delete(id) - for dependant, method, *opt in assocs + for dependant, method, opt in assocs dependant.send(method, id, *opt) end end diff --git a/lib/thread.rb b/lib/thread.rb index c33333f5f3..91c588f603 100644 --- a/lib/thread.rb +++ b/lib/thread.rb @@ -50,14 +50,11 @@ class Mutex def unlock return unless @locked - Thread.critical = true - wait = @waiting - @waiting = [] - @locked = false - Thread.critical = false - for w in wait - w.run - end + Thread.critical = TRUE + t = @waiting.shift + @locked = FALSE + Thread.critical = FALSE + t.run if t self end |