| 1 | <HTML |
| 2 | ><HEAD |
| 3 | ><TITLE |
| 4 | >SDL_CondWaitTimeout</TITLE |
| 5 | ><META |
| 6 | NAME="GENERATOR" |
| 7 | CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+ |
| 8 | "><LINK |
| 9 | REL="HOME" |
| 10 | TITLE="SDL Library Documentation" |
| 11 | HREF="index.html"><LINK |
| 12 | REL="UP" |
| 13 | TITLE="Multi-threaded Programming" |
| 14 | HREF="thread.html"><LINK |
| 15 | REL="PREVIOUS" |
| 16 | TITLE="SDL_CondWait" |
| 17 | HREF="sdlcondwait.html"><LINK |
| 18 | REL="NEXT" |
| 19 | TITLE="Time" |
| 20 | HREF="time.html"></HEAD |
| 21 | ><BODY |
| 22 | CLASS="REFENTRY" |
| 23 | BGCOLOR="#FFF8DC" |
| 24 | TEXT="#000000" |
| 25 | LINK="#0000ee" |
| 26 | VLINK="#551a8b" |
| 27 | ALINK="#ff0000" |
| 28 | ><DIV |
| 29 | CLASS="NAVHEADER" |
| 30 | ><TABLE |
| 31 | SUMMARY="Header navigation table" |
| 32 | WIDTH="100%" |
| 33 | BORDER="0" |
| 34 | CELLPADDING="0" |
| 35 | CELLSPACING="0" |
| 36 | ><TR |
| 37 | ><TH |
| 38 | COLSPAN="3" |
| 39 | ALIGN="center" |
| 40 | >SDL Library Documentation</TH |
| 41 | ></TR |
| 42 | ><TR |
| 43 | ><TD |
| 44 | WIDTH="10%" |
| 45 | ALIGN="left" |
| 46 | VALIGN="bottom" |
| 47 | ><A |
| 48 | HREF="sdlcondwait.html" |
| 49 | ACCESSKEY="P" |
| 50 | >Prev</A |
| 51 | ></TD |
| 52 | ><TD |
| 53 | WIDTH="80%" |
| 54 | ALIGN="center" |
| 55 | VALIGN="bottom" |
| 56 | ></TD |
| 57 | ><TD |
| 58 | WIDTH="10%" |
| 59 | ALIGN="right" |
| 60 | VALIGN="bottom" |
| 61 | ><A |
| 62 | HREF="time.html" |
| 63 | ACCESSKEY="N" |
| 64 | >Next</A |
| 65 | ></TD |
| 66 | ></TR |
| 67 | ></TABLE |
| 68 | ><HR |
| 69 | ALIGN="LEFT" |
| 70 | WIDTH="100%"></DIV |
| 71 | ><H1 |
| 72 | ><A |
| 73 | NAME="SDLCONDWAITTIMEOUT" |
| 74 | ></A |
| 75 | >SDL_CondWaitTimeout</H1 |
| 76 | ><DIV |
| 77 | CLASS="REFNAMEDIV" |
| 78 | ><A |
| 79 | NAME="AEN8393" |
| 80 | ></A |
| 81 | ><H2 |
| 82 | >Name</H2 |
| 83 | >SDL_CondWaitTimeout -- Wait on a condition variable, with timeout</DIV |
| 84 | ><DIV |
| 85 | CLASS="REFSYNOPSISDIV" |
| 86 | ><A |
| 87 | NAME="AEN8396" |
| 88 | ></A |
| 89 | ><H2 |
| 90 | >Synopsis</H2 |
| 91 | ><DIV |
| 92 | CLASS="FUNCSYNOPSIS" |
| 93 | ><A |
| 94 | NAME="AEN8397" |
| 95 | ></A |
| 96 | ><P |
| 97 | ></P |
| 98 | ><PRE |
| 99 | CLASS="FUNCSYNOPSISINFO" |
| 100 | >#include "SDL.h" |
| 101 | #include "SDL_thread.h"</PRE |
| 102 | ><P |
| 103 | ><CODE |
| 104 | ><CODE |
| 105 | CLASS="FUNCDEF" |
| 106 | >int <B |
| 107 | CLASS="FSFUNC" |
| 108 | >SDL_CondWaitTimeout</B |
| 109 | ></CODE |
| 110 | >(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms);</CODE |
| 111 | ></P |
| 112 | ><P |
| 113 | ></P |
| 114 | ></DIV |
| 115 | ></DIV |
| 116 | ><DIV |
| 117 | CLASS="REFSECT1" |
| 118 | ><A |
| 119 | NAME="AEN8403" |
| 120 | ></A |
| 121 | ><H2 |
| 122 | >Description</H2 |
| 123 | ><P |
| 124 | >Wait on the condition variable <TT |
| 125 | CLASS="PARAMETER" |
| 126 | ><I |
| 127 | >cond</I |
| 128 | ></TT |
| 129 | > for, at most, <TT |
| 130 | CLASS="PARAMETER" |
| 131 | ><I |
| 132 | >ms</I |
| 133 | ></TT |
| 134 | > milliseconds. <TT |
| 135 | CLASS="PARAMETER" |
| 136 | ><I |
| 137 | >mut</I |
| 138 | ></TT |
| 139 | > is unlocked so it must be locked when the function is called. Returns <TT |
| 140 | CLASS="LITERAL" |
| 141 | >SDL_MUTEX_TIMEDOUT</TT |
| 142 | > if the condition is not signalled in the allotted time, <SPAN |
| 143 | CLASS="RETURNVALUE" |
| 144 | >0</SPAN |
| 145 | > if it was signalled or <SPAN |
| 146 | CLASS="RETURNVALUE" |
| 147 | >-1</SPAN |
| 148 | > on an error.</P |
| 149 | ></DIV |
| 150 | ><DIV |
| 151 | CLASS="REFSECT1" |
| 152 | ><A |
| 153 | NAME="AEN8412" |
| 154 | ></A |
| 155 | ><H2 |
| 156 | >See Also</H2 |
| 157 | ><P |
| 158 | ><A |
| 159 | HREF="sdlcondwait.html" |
| 160 | ><TT |
| 161 | CLASS="FUNCTION" |
| 162 | >SDL_CondWait</TT |
| 163 | ></A |
| 164 | ></P |
| 165 | ></DIV |
| 166 | ><DIV |
| 167 | CLASS="NAVFOOTER" |
| 168 | ><HR |
| 169 | ALIGN="LEFT" |
| 170 | WIDTH="100%"><TABLE |
| 171 | SUMMARY="Footer navigation table" |
| 172 | WIDTH="100%" |
| 173 | BORDER="0" |
| 174 | CELLPADDING="0" |
| 175 | CELLSPACING="0" |
| 176 | ><TR |
| 177 | ><TD |
| 178 | WIDTH="33%" |
| 179 | ALIGN="left" |
| 180 | VALIGN="top" |
| 181 | ><A |
| 182 | HREF="sdlcondwait.html" |
| 183 | ACCESSKEY="P" |
| 184 | >Prev</A |
| 185 | ></TD |
| 186 | ><TD |
| 187 | WIDTH="34%" |
| 188 | ALIGN="center" |
| 189 | VALIGN="top" |
| 190 | ><A |
| 191 | HREF="index.html" |
| 192 | ACCESSKEY="H" |
| 193 | >Home</A |
| 194 | ></TD |
| 195 | ><TD |
| 196 | WIDTH="33%" |
| 197 | ALIGN="right" |
| 198 | VALIGN="top" |
| 199 | ><A |
| 200 | HREF="time.html" |
| 201 | ACCESSKEY="N" |
| 202 | >Next</A |
| 203 | ></TD |
| 204 | ></TR |
| 205 | ><TR |
| 206 | ><TD |
| 207 | WIDTH="33%" |
| 208 | ALIGN="left" |
| 209 | VALIGN="top" |
| 210 | >SDL_CondWait</TD |
| 211 | ><TD |
| 212 | WIDTH="34%" |
| 213 | ALIGN="center" |
| 214 | VALIGN="top" |
| 215 | ><A |
| 216 | HREF="thread.html" |
| 217 | ACCESSKEY="U" |
| 218 | >Up</A |
| 219 | ></TD |
| 220 | ><TD |
| 221 | WIDTH="33%" |
| 222 | ALIGN="right" |
| 223 | VALIGN="top" |
| 224 | >Time</TD |
| 225 | ></TR |
| 226 | ></TABLE |
| 227 | ></DIV |
| 228 | ></BODY |
| 229 | ></HTML |
| 230 | > |