pub fn awaken(process: RcProcess) -> Result<bool, process::State> {
    use process::State::{Running, Sleeping};

    let state = process.lock().state();

    match state {
        Running => Ok(false),
        Sleeping => {
            process.lock().awaken();
            push(process);
            Ok(true)
        },
        _ => Err(state)
    }
}
/// Given a sleeping process, wakes it up and pushes it on to the end of the run
/// queue.
///
/// # Returns
///
/// - `Ok(true)` if the process was awoken
/// - `Ok(false)` if the process was already running
/// - `Err(state)` if the process was neither `Running` nor `Sleeping`.
Given a sleeping process, wakes it up and pushes it on to the end of the run
queue.
Given a sleeping process wakes it up and pushes it on to the end of the run queue .
pub fn awaken(process: RcProcess) -> Result<bool, process::State> {
    use process::State::{Running, Sleeping};
    let state = process.lock().state();
    match state {
        Running => Ok(false),
        Sleeping => {
            process.lock().awaken();
            push(process);
            Ok(true)
        },
        _ => Err(state)
    }
}
pub fn awaken ( process : RcProcess ) -> Result < bool , process :: State > { use process :: State :: { Running , Sleeping } ; let state = process . lock ( ) . state ( ) ; match state { Running => Ok ( false ) , Sleeping => { process . lock ( ) . awaken ( ) ; push ( process ) ; Ok ( true ) } , _ => Err ( state ) } }
Given a sleeping process, wakes it up and pushes it on to the end of the run
queue.
Given a sleeping process wakes it up and pushes it on to the end of the run queue .
if the process was awoken
if the process was awoken
k(true
if the process was already running
if the process was already running
k(false
if the process was neither `Running` nor `Sleeping`.
if the process was neither ` Running ` nor ` Sleeping ` .
rr(state
process
RcProcess