mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Document the various scheduler hooks
This commit is contained in:
parent
9472d16061
commit
deffb63021
1 changed files with 3 additions and 0 deletions
|
@ -114,6 +114,7 @@ class Scheduler
|
|||
return true
|
||||
end
|
||||
|
||||
# Used for Kernel#sleep and Mutex#sleep
|
||||
def kernel_sleep(duration = nil)
|
||||
# p [__method__, duration]
|
||||
if duration
|
||||
|
@ -125,6 +126,7 @@ class Scheduler
|
|||
return true
|
||||
end
|
||||
|
||||
# Used when blocking on synchronization (Mutex#lock, Queue#pop, SizedQueue#push, ...)
|
||||
def block(blocker)
|
||||
# p [__method__, blocker]
|
||||
@locking += 1
|
||||
|
@ -133,6 +135,7 @@ class Scheduler
|
|||
@locking -= 1
|
||||
end
|
||||
|
||||
# Used when synchronization wakes up a previously-blocked fiber (Mutex#unlock, Queue#push, ...)
|
||||
def unblock(blocker, fiber)
|
||||
# p [__method__, blocker, fiber]
|
||||
@lock.synchronize do
|
||||
|
|
Loading…
Reference in a new issue