-.if \n(sw=0 .ig sw
-Two routines provide services analogous to the kernel
-\fIsleep\fP and \fIwakeup\fP functions interpreted in the domain of
-shared memory.
-A process may relinquish the processor by calling \fImsleep\fP:
-.DS
-msleep(sem)
-semaphore *sem;
-.DE
-\fISem\fP must lie within a MAP_SHARED region with at least modes
-PROT_READ and PROT_WRITE.
-The MAP_HASSEMAPHORE flag must have been specified when the region was created.
-The process will remain in a sleeping state
-until some other process issues an \fImwakeup\fP for the same semaphore
-within the region using the call:
-.DS
-mwakeup(sem)
-semaphore *sem;
-.DE
-An \fImwakeup\fP may awaken all sleepers on the semaphore,
-or may awaken only the next sleeper on a queue.
-.PP
-To avoid system calls for the usual case of an uncontested lock,
-routines are provided to acquire and release locks.
-.sw
-.if \n(sw .ig sw