home *** CD-ROM | disk | FTP | other *** search
- /******************************************
- * WAKEPROC.C *
- * Copyright TimeSlice, Inc. 1985, 86, 87. *
- ******************************************/
-
- #include <ts.h>
-
- /***
- * WAKEPROC( PPTR, EVENT )
- * This function wakes up the process pointed by PPTR, and places it
- * in front of the process list. The process structure of the task awakened,
- * has its event member set to EVENT.
- ***/
- void wakeproc( pptr , event )
- PROCESS *pptr;
- int event;
- {
- PROCESS *pp ;
-
- if( curproc != pptr ) { /*if not currently running*/
- ssleep(); /*put switcher to sleep */
- for( pp = curproc ; pp->nxt != pptr && pp->nxt != curproc; pp = pp->nxt );
- if ( pp->nxt != curproc ) { /*if process exists*/
- pp->nxt = pptr->nxt; /*place pptr in front of ...*/
- pptr->nxt = curproc->nxt; /*...process list*/
- curproc->nxt = pptr;
- }
- swake(); /*wake up switcher*/
- }
- pptr->status &= ~ASLEEP ; /*wake up pptr*/
- pptr->event = event; /*tell pptr what woke it up*/
- }
-
-