Beispiel #1
0
void OSSim::eventWait(Pid_t cpid)
{
    // All the threads have already finished
    if(cpid<0)
        return;
    LOG("OSSim::wait (cpid %d)", cpid);
    ProcessId *proc = ProcessId::getProcessId(cpid);
    if(proc->getNChilds()==0) {
        // No child pending
        return;
    }
    // Should be still running
    I(proc->getState()==RunningState);
    // Make it non-runnable
    cpus.makeNonRunnable(proc);
    // Set state to WaitingState
    proc->setState(WaitingState);
}