File:  [XINU] / xinu / sys / sleep10.c
Revision 1.1.1.2 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:39:16 2018 UTC (8 years, 3 months ago) by root
Branches: xinu, MAIN
CVS tags: xinu-19910600, HEAD
Xinu for 68000/68010

/* sleep10.c - sleep10 */

#include <conf.h>
#include <kernel.h>
#include <proc.h>
#include <q.h>
#include <sleep.h>

/*------------------------------------------------------------------------
 * sleep10  --  delay the caller for a time specified in tenths of seconds
 *------------------------------------------------------------------------
 */
SYSCALL	sleep10(n)
	int	n;
{
#ifdef	DEBUG1
	dotrace("sleep10", &n, 1);
#endif
	if (n < 0  || clkruns==0)
		return(SYSERR);
	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();
	return(OK);
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.