Document the various scheduler hooks
This commit is contained in:
parent
9472d16061
commit
deffb63021
@ -114,6 +114,7 @@ class Scheduler
|
|||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Used for Kernel#sleep and Mutex#sleep
|
||||||
def kernel_sleep(duration = nil)
|
def kernel_sleep(duration = nil)
|
||||||
# p [__method__, duration]
|
# p [__method__, duration]
|
||||||
if duration
|
if duration
|
||||||
@ -125,6 +126,7 @@ class Scheduler
|
|||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Used when blocking on synchronization (Mutex#lock, Queue#pop, SizedQueue#push, ...)
|
||||||
def block(blocker)
|
def block(blocker)
|
||||||
# p [__method__, blocker]
|
# p [__method__, blocker]
|
||||||
@locking += 1
|
@locking += 1
|
||||||
@ -133,6 +135,7 @@ class Scheduler
|
|||||||
@locking -= 1
|
@locking -= 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Used when synchronization wakes up a previously-blocked fiber (Mutex#unlock, Queue#push, ...)
|
||||||
def unblock(blocker, fiber)
|
def unblock(blocker, fiber)
|
||||||
# p [__method__, blocker, fiber]
|
# p [__method__, blocker, fiber]
|
||||||
@lock.synchronize do
|
@lock.synchronize do
|
||||||
|
Loading…
x
Reference in New Issue
Block a user