--- xinu/sys/sleep10.c 2018/04/24 17:39:02 1.1 +++ xinu/sys/sleep10.c 2018/04/24 17:39:16 1.1.1.2 @@ -11,22 +11,25 @@ *------------------------------------------------------------------------ */ SYSCALL sleep10(n) - int n; + int n; { - PStype ps; - +#ifdef DEBUG1 + dotrace("sleep10", &n, 1); +#endif if (n < 0 || clkruns==0) return(SYSERR); - disable(ps); - if (n == 0) { /* sleep10(0) -> end time slice */ - ; - } else { - insertd(currpid,clockq,n); - slnempty = TRUE; - sltop = (short *) & q[q[clockq].qnext].qkey; - proctab[currpid].pstate = PRSLEEP; + if (n == 0) { + disable(); + resched(); + restore(); + return(OK); } + disable(); + insertd(currpid,clockq,n); + slnempty = TRUE; + sltop = &q[q[clockq].qnext].qkey; + proctab[currpid].pstate = PRSLEEP; resched(); - restore(ps); + restore(); return(OK); }