Sophie

Sophie

distrib > Mandriva > 9.0 > i586 > by-pkgid > 98e91bc877e03cf3582cd163550eb7e3 > files > 543

kernel-doc-html-2.4.19-16mdk.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<HTML
><HEAD
><TITLE
>Wait Queues
   include/linux/wait.h
  </TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
TITLE="Unreliable Guide To Hacking The Linux Kernel"
HREF="book1.html"><LINK
REL="PREVIOUS"
TITLE=" MOD_INC_USE_COUNT/MOD_DEC_USE_COUNT
    include/linux/module.h"
HREF="x310.html"><LINK
REL="NEXT"
TITLE="Queuing"
HREF="x339.html"></HEAD
><BODY
CLASS="CHAPTER"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Unreliable Guide To Hacking The Linux Kernel</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="x310.html"
ACCESSKEY="P"
>&#60;&#60;&#60; Previous</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="x339.html"
ACCESSKEY="N"
>Next &#62;&#62;&#62;</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="CHAPTER"
><H1
><A
NAME="QUEUES"
></A
>Wait Queues
   <TT
CLASS="FILENAME"
>include/linux/wait.h</TT
>
  </H1
><P
>   <I
CLASS="EMPHASIS"
>[SLEEPS]</I
>
  </P
><P
>   A wait queue is used to wait for someone to wake you up when a
   certain condition is true.  They must be used carefully to ensure
   there is no race condition.  You declare a
   <SPAN
CLASS="TYPE"
>wait_queue_head_t</SPAN
>, and then processes which want to
   wait for that condition declare a <SPAN
CLASS="TYPE"
>wait_queue_t</SPAN
>
   referring to themselves, and place that in the queue.
  </P
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="QUEUE-DECLARING"
></A
>Declaring</H1
><P
>    You declare a <SPAN
CLASS="TYPE"
>wait_queue_head_t</SPAN
> using the
    <TT
CLASS="FUNCTION"
>DECLARE_WAIT_QUEUE_HEAD()</TT
> macro, or using the
    <TT
CLASS="FUNCTION"
>init_waitqueue_head()</TT
> routine in your
    initialization code.
   </P
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="x310.html"
ACCESSKEY="P"
>&#60;&#60;&#60; Previous</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="book1.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="x339.html"
ACCESSKEY="N"
>Next &#62;&#62;&#62;</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><TT
CLASS="FUNCTION"
>MOD_INC_USE_COUNT</TT
>/<TT
CLASS="FUNCTION"
>MOD_DEC_USE_COUNT</TT
>
    <TT
CLASS="FILENAME"
>include/linux/module.h</TT
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
>&nbsp;</TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Queuing</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>