Defer kernel_sleep to block to avoid exiting the event loop when duration is nil.

This commit is contained in:
Samuel Williams 2020-11-08 16:19:39 +13:00
parent c39984ec5c
commit 57b83dad4c
Notes: git 2020-11-08 16:41:18 +09:00

View File

@ -135,12 +135,7 @@ class Scheduler
# Used for Kernel#sleep and Mutex#sleep
def kernel_sleep(duration = nil)
# p [__method__, duration]
if duration
@waiting[Fiber.current] = current_time + duration
end
Fiber.yield
self.block(:sleep, duration)
return true
end