'\"macro stdmacro
.if n .pH ddi_dki.wakeup @(#)wakeup	40.9 of 11/16/89
.\" Copyright 1989 AT&T
.de IX
.ie '\\n(.z'' .tm .Index: \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9	\\n%
.el \\!.IX \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
..
.nr X
.if \nX=0 .ds x} wakeup D3DK "" "DDI/DKI" "\&"
.if \nX=1 .ds x} wakeup D3DK "" "DDI/DKI"
.if \nX=2 .ds x} wakeup D3DK "" "\&"
.if \nX=3 .ds x} wakeup "" "" "\&"
.TH \*(x}
.IX "\f4wakeup\fP(D3DK)"
.SH NAME
\f4wakeup\f1 \- resume suspended process execution
.SH SYNOPSIS
.nf
.na
\f4#include <sys/types.h>
.sp 0.5
void wakeup(caddr_t\f2 event\f4);\f1
.ad
.fi
.SH ARGUMENT
.RS 0n 10
.IP "\f2event\f1" 10n
Address that is the same address used by \f4sleep\f1(D3DK) to suspend
process execution.
.RE
.SH DESCRIPTION
\f4wakeup\f1 awakens all processes that called \f4sleep\f1 with an
address as the \f2event\f1 argument.  This lets the processes execute
according to the scheduler.  Ensure that the same \f2event\f1 argument
is used  for both \f4sleep\f1 and \f4wakeup\f1.  It is recommended
for code readability and for efficiency to have a one-to-one
correspondence between events and \f4sleep\f1 addresses.  Also, there
is usually one bit in the driver flag member that corresponds to the
reason for calling \f4sleep\f1.
.P
Whenever a driver calls \f4sleep\f1, it should test to ensure the
event on which the driver called \f4sleep\f1 occurred. There is an
interval between the time the process that called \f4sleep\f1 is
awakened and the time it resumes execution where the state forcing the
\f4sleep\f1 may have been reentered.  This can occur because all
processes waiting for an event are awakened at the same time.  The first
process given control by the scheduler usually gains control of the
event.  All other processes awakened should recognize that they cannot
continue and should reissue 
\f4sleep\f1.
.SH RETURN VALUE
None
.SH LEVEL
Base or Interrupt
.SH SEE ALSO
\f2BCI Driver Development Guide\f1, Chapter 10, ``Synchronizing Hardware and Software Events''
.P
.na
\f4delay\f1(D3DK),
\f4biodone\f1(D3DK),
\f4biowait\f1(D3DK),
\f4sleep\f1(D3DK),
\f4timeout\f1(D3DK),
\f4untimeout\f1(D3DK)
.ad
.SH EXAMPLE
See the \f4untimeout\f1(D3DK) function page for an example of \f4wakeup\f1.
