docs/html/sdlsemwait.html
changeset 3352 6dc250ebdd80
parent 3351 8e0182c236d8
child 3353 6b14223dd5c7
     1.1 --- a/docs/html/sdlsemwait.html	Wed Oct 07 06:11:53 2009 +0000
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,298 +0,0 @@
     1.4 -<HTML
     1.5 -><HEAD
     1.6 -><TITLE
     1.7 ->SDL_SemWait</TITLE
     1.8 -><META
     1.9 -NAME="GENERATOR"
    1.10 -CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
    1.11 -"><LINK
    1.12 -REL="HOME"
    1.13 -TITLE="SDL Library Documentation"
    1.14 -HREF="index.html"><LINK
    1.15 -REL="UP"
    1.16 -TITLE="Multi-threaded Programming"
    1.17 -HREF="thread.html"><LINK
    1.18 -REL="PREVIOUS"
    1.19 -TITLE="SDL_DestroySemaphore"
    1.20 -HREF="sdldestroysemaphore.html"><LINK
    1.21 -REL="NEXT"
    1.22 -TITLE="SDL_SemTryWait"
    1.23 -HREF="sdlsemtrywait.html"></HEAD
    1.24 -><BODY
    1.25 -CLASS="REFENTRY"
    1.26 -BGCOLOR="#FFF8DC"
    1.27 -TEXT="#000000"
    1.28 -LINK="#0000ee"
    1.29 -VLINK="#551a8b"
    1.30 -ALINK="#ff0000"
    1.31 -><DIV
    1.32 -CLASS="NAVHEADER"
    1.33 -><TABLE
    1.34 -SUMMARY="Header navigation table"
    1.35 -WIDTH="100%"
    1.36 -BORDER="0"
    1.37 -CELLPADDING="0"
    1.38 -CELLSPACING="0"
    1.39 -><TR
    1.40 -><TH
    1.41 -COLSPAN="3"
    1.42 -ALIGN="center"
    1.43 ->SDL Library Documentation</TH
    1.44 -></TR
    1.45 -><TR
    1.46 -><TD
    1.47 -WIDTH="10%"
    1.48 -ALIGN="left"
    1.49 -VALIGN="bottom"
    1.50 -><A
    1.51 -HREF="sdldestroysemaphore.html"
    1.52 -ACCESSKEY="P"
    1.53 ->Prev</A
    1.54 -></TD
    1.55 -><TD
    1.56 -WIDTH="80%"
    1.57 -ALIGN="center"
    1.58 -VALIGN="bottom"
    1.59 -></TD
    1.60 -><TD
    1.61 -WIDTH="10%"
    1.62 -ALIGN="right"
    1.63 -VALIGN="bottom"
    1.64 -><A
    1.65 -HREF="sdlsemtrywait.html"
    1.66 -ACCESSKEY="N"
    1.67 ->Next</A
    1.68 -></TD
    1.69 -></TR
    1.70 -></TABLE
    1.71 -><HR
    1.72 -ALIGN="LEFT"
    1.73 -WIDTH="100%"></DIV
    1.74 -><H1
    1.75 -><A
    1.76 -NAME="SDLSEMWAIT"
    1.77 -></A
    1.78 ->SDL_SemWait</H1
    1.79 -><DIV
    1.80 -CLASS="REFNAMEDIV"
    1.81 -><A
    1.82 -NAME="AEN8023"
    1.83 -></A
    1.84 -><H2
    1.85 ->Name</H2
    1.86 ->SDL_SemWait&nbsp;--&nbsp;Lock a semaphore and suspend the thread if the semaphore value is zero.</DIV
    1.87 -><DIV
    1.88 -CLASS="REFSYNOPSISDIV"
    1.89 -><A
    1.90 -NAME="AEN8026"
    1.91 -></A
    1.92 -><H2
    1.93 ->Synopsis</H2
    1.94 -><DIV
    1.95 -CLASS="FUNCSYNOPSIS"
    1.96 -><A
    1.97 -NAME="AEN8027"
    1.98 -></A
    1.99 -><P
   1.100 -></P
   1.101 -><PRE
   1.102 -CLASS="FUNCSYNOPSISINFO"
   1.103 ->#include "SDL.h"
   1.104 -#include "SDL_thread.h"</PRE
   1.105 -><P
   1.106 -><CODE
   1.107 -><CODE
   1.108 -CLASS="FUNCDEF"
   1.109 ->int <B
   1.110 -CLASS="FSFUNC"
   1.111 ->SDL_SemWait</B
   1.112 -></CODE
   1.113 ->(SDL_sem *sem);</CODE
   1.114 -></P
   1.115 -><P
   1.116 -></P
   1.117 -></DIV
   1.118 -></DIV
   1.119 -><DIV
   1.120 -CLASS="REFSECT1"
   1.121 -><A
   1.122 -NAME="AEN8033"
   1.123 -></A
   1.124 -><H2
   1.125 ->Description</H2
   1.126 -><P
   1.127 -><TT
   1.128 -CLASS="FUNCTION"
   1.129 ->SDL_SemWait()</TT
   1.130 -> suspends the calling thread until either
   1.131 -the semaphore pointed to by <TT
   1.132 -CLASS="PARAMETER"
   1.133 -><I
   1.134 ->sem</I
   1.135 -></TT
   1.136 -> has a positive value,
   1.137 -the call is interrupted by a signal or error. If the call is successful it
   1.138 -will atomically decrement the semaphore value.</P
   1.139 -><P
   1.140 ->After <TT
   1.141 -CLASS="FUNCTION"
   1.142 ->SDL_SemWait()</TT
   1.143 -> is successful, the semaphore
   1.144 -can be released and its count atomically incremented by a successful call to
   1.145 -<A
   1.146 -HREF="sdlsempost.html"
   1.147 ->SDL_SemPost</A
   1.148 ->.</P
   1.149 -></DIV
   1.150 -><DIV
   1.151 -CLASS="REFSECT1"
   1.152 -><A
   1.153 -NAME="AEN8041"
   1.154 -></A
   1.155 -><H2
   1.156 ->Return Value</H2
   1.157 -><P
   1.158 ->Returns <SPAN
   1.159 -CLASS="RETURNVALUE"
   1.160 ->0</SPAN
   1.161 -> if successful or
   1.162 -<SPAN
   1.163 -CLASS="RETURNVALUE"
   1.164 ->-1</SPAN
   1.165 -> if there was an error (leaving the semaphore unchanged).</P
   1.166 -></DIV
   1.167 -><DIV
   1.168 -CLASS="REFSECT1"
   1.169 -><A
   1.170 -NAME="AEN8046"
   1.171 -></A
   1.172 -><H2
   1.173 ->Examples</H2
   1.174 -><P
   1.175 -><PRE
   1.176 -CLASS="PROGRAMLISTING"
   1.177 ->if (SDL_SemWait(my_sem) == -1) {
   1.178 -        return WAIT_FAILED;
   1.179 -}
   1.180 -
   1.181 -...
   1.182 -
   1.183 -SDL_SemPost(my_sem);</PRE
   1.184 -></P
   1.185 -></DIV
   1.186 -><DIV
   1.187 -CLASS="REFSECT1"
   1.188 -><A
   1.189 -NAME="AEN8050"
   1.190 -></A
   1.191 -><H2
   1.192 ->See Also</H2
   1.193 -><P
   1.194 -><A
   1.195 -HREF="sdlcreatesemaphore.html"
   1.196 -><TT
   1.197 -CLASS="FUNCTION"
   1.198 ->SDL_CreateSemaphore</TT
   1.199 -></A
   1.200 ->,
   1.201 -<A
   1.202 -HREF="sdldestroysemaphore.html"
   1.203 -><TT
   1.204 -CLASS="FUNCTION"
   1.205 ->SDL_DestroySemaphore</TT
   1.206 -></A
   1.207 ->,
   1.208 -<A
   1.209 -HREF="sdlsemtrywait.html"
   1.210 -><TT
   1.211 -CLASS="FUNCTION"
   1.212 ->SDL_SemTryWait</TT
   1.213 -></A
   1.214 ->,
   1.215 -<A
   1.216 -HREF="sdlsemwaittimeout.html"
   1.217 -><TT
   1.218 -CLASS="FUNCTION"
   1.219 ->SDL_SemWaitTimeout</TT
   1.220 -></A
   1.221 ->,
   1.222 -<A
   1.223 -HREF="sdlsempost.html"
   1.224 -><TT
   1.225 -CLASS="FUNCTION"
   1.226 ->SDL_SemPost</TT
   1.227 -></A
   1.228 ->,
   1.229 -<A
   1.230 -HREF="sdlsemvalue.html"
   1.231 -><TT
   1.232 -CLASS="FUNCTION"
   1.233 ->SDL_SemValue</TT
   1.234 -></A
   1.235 -></P
   1.236 -></DIV
   1.237 -><DIV
   1.238 -CLASS="NAVFOOTER"
   1.239 -><HR
   1.240 -ALIGN="LEFT"
   1.241 -WIDTH="100%"><TABLE
   1.242 -SUMMARY="Footer navigation table"
   1.243 -WIDTH="100%"
   1.244 -BORDER="0"
   1.245 -CELLPADDING="0"
   1.246 -CELLSPACING="0"
   1.247 -><TR
   1.248 -><TD
   1.249 -WIDTH="33%"
   1.250 -ALIGN="left"
   1.251 -VALIGN="top"
   1.252 -><A
   1.253 -HREF="sdldestroysemaphore.html"
   1.254 -ACCESSKEY="P"
   1.255 ->Prev</A
   1.256 -></TD
   1.257 -><TD
   1.258 -WIDTH="34%"
   1.259 -ALIGN="center"
   1.260 -VALIGN="top"
   1.261 -><A
   1.262 -HREF="index.html"
   1.263 -ACCESSKEY="H"
   1.264 ->Home</A
   1.265 -></TD
   1.266 -><TD
   1.267 -WIDTH="33%"
   1.268 -ALIGN="right"
   1.269 -VALIGN="top"
   1.270 -><A
   1.271 -HREF="sdlsemtrywait.html"
   1.272 -ACCESSKEY="N"
   1.273 ->Next</A
   1.274 -></TD
   1.275 -></TR
   1.276 -><TR
   1.277 -><TD
   1.278 -WIDTH="33%"
   1.279 -ALIGN="left"
   1.280 -VALIGN="top"
   1.281 ->SDL_DestroySemaphore</TD
   1.282 -><TD
   1.283 -WIDTH="34%"
   1.284 -ALIGN="center"
   1.285 -VALIGN="top"
   1.286 -><A
   1.287 -HREF="thread.html"
   1.288 -ACCESSKEY="U"
   1.289 ->Up</A
   1.290 -></TD
   1.291 -><TD
   1.292 -WIDTH="33%"
   1.293 -ALIGN="right"
   1.294 -VALIGN="top"
   1.295 ->SDL_SemTryWait</TD
   1.296 -></TR
   1.297 -></TABLE
   1.298 -></DIV
   1.299 -></BODY
   1.300 -></HTML
   1.301 ->
   1.302 \ No newline at end of file