|
|
1.1 ! root 1: /* ready.c - ready */ ! 2: ! 3: #include <conf.h> ! 4: #include <kernel.h> ! 5: #include <proc.h> ! 6: #include <q.h> ! 7: ! 8: /*------------------------------------------------------------------------ ! 9: * ready -- make a process eligible for CPU service ! 10: *------------------------------------------------------------------------ ! 11: */ ! 12: int ready (pid, resch) ! 13: int pid; /* id of process to make ready */ ! 14: int resch; /* reschedule afterward? */ ! 15: { ! 16: register struct pentry *pptr; ! 17: ! 18: if (isbadpid(pid)) ! 19: return(SYSERR); ! 20: pptr = &proctab[pid]; ! 21: pptr->pstate = PRREADY; ! 22: insert(pid,rdyhead,pptr->pprio); ! 23: if (resch) ! 24: resched(); ! 25: return(OK); ! 26: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.