1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<HTML>
3<HEAD>
4<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
5<META http-equiv="Content-Style-Type" content="text/css">
6<LINK rel="stylesheet" type="text/css" href="../../CSS/revolution.css">
7<TITLE>OSTryWaitSemaphore</TITLE>
8</HEAD>
9<BODY>
10<H1>OSTryWaitSemaphore</H1>
11<H2>C Specification</H2>
12<DL>
13  <DD>
14<PRE><CODE>#include &lt;revolution/os.h&gt;</CODE></PRE>
15  <DD>
16<PRE><CODE>s32  OSTryWaitSemaphore ( OSSemaphore* sem );</CODE></PRE>
17</DL>
18<H2>Arguments</H2>
19<TABLE border="1" cellpadding="3" cellspacing="0.1">
20  <TBODY>
21    <TR>
22<TD width="120" bgcolor="#ffffe8"><I><B><CODE><STRONG><EM><CODE>sem</CODE></EM></STRONG></CODE></B></I></TD>
23<TD width="520">Pointer to a semaphore.</TD>
24    </TR>
25  </TBODY>
26</TABLE>
27<H2>Return Values</H2>
28<P>Previous semaphore count. A positive return value indicates that decrementing the semaphore was successful. Otherwise, the semaphore status is unchanged. </P>
29<H2>Description</H2>
30<P>If the semaphore count is greater than zero, the count is decremented. Otherwise, this function returns without taking any action. </P>
31
32<H2>See Also</H2>
33<P><a href="../list.html#Thread" target="contents">Thread Functions</a>, <a href="../list.html#ThreadSynchronization" target="contents">Thread Synchronization Functions</a></P>
34<H2>Revision History</H2>
35<P>03/01/2006 Initial version.</P>
36</BODY>
37</HTML>