Land #2413, axe callcc
This is the only time callcc is used in the entire codebase, too, so this apparently removes a roadblack to non-MRI Rubies, so that's nice.bug/bundler_fix
commit
85112e8704
|
@ -61,22 +61,12 @@ class Event
|
|||
# Waits for the event to become signaled. Timeout is measured in
|
||||
# seconds. Raises TimeoutError if the condition does not become signaled.
|
||||
#
|
||||
|
||||
begin
|
||||
# XXX: we need to replace this code
|
||||
# continuations slow down YARV
|
||||
require "continuation" if not defined? callcc
|
||||
rescue ::LoadError
|
||||
end
|
||||
|
||||
def wait(t = Infinite)
|
||||
callcc { |ctx|
|
||||
self.mutex.synchronize {
|
||||
ctx.call if (self.state == true)
|
||||
self.mutex.synchronize {
|
||||
break if (self.state == true)
|
||||
|
||||
Timeout.timeout(t) {
|
||||
self.cond.wait(self.mutex)
|
||||
}
|
||||
Timeout.timeout(t) {
|
||||
self.cond.wait(self.mutex)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue