[−][src]Function kernel::process::process::sleep
pub fn sleep<T, U>(channel: *const T, lck: MutexGuard<U>) -> MutexGuard<U>
put this process into sleep state
channel
is an identifier of sleep lock channel. wakeup
should be called with the same
channel to properly wakeup previously slept process.
lck
is the spinlock to be temporarily unlocked.
Returns the lck
spinlock.
Technical Details
To avoid the lost wakeup issue, process must hold a global lock PROCS_POOL_SLEEP
.
This lock will be dropped after the process is put back into process pool.