1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3
4<head>
5<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
6<META name="GENERATOR" content="Microsoft FrontPage 5.0">
7<META http-equiv="Content-Style-Type" content="text/css">
8<LINK rel="stylesheet" type="text/css" href="../../CSS/revolution.css">
9<title>OSLockMutex</title>
10</head>
11
12<body>
13
14<h1>OSLockMutex</h1>
15
16<h2>Syntax</h2>
17<dl><dd><pre class="construction">
18#include &lt;revolution/os.h&gt;
19
20void OSLockMutex(OSMutex* mutex);
21</pre></dd></dl>
22
23<h2>Arguments</h2>
24<TABLE class="arguments" border="1" >
25  <tr>
26<TH><STRONG><EM><CODE>mutex</CODE></EM></STRONG></TH>
27<TD>Pointer to mutex.</TD>
28  </tr>
29</TABLE>
30
31<h2>Return Values</h2>
32<p>None.</p>
33
34<h2>Description</h2>
35<p>The calling thread tries to lock the mutex specified by <SPAN class="argument">mutex</SPAN>.</p>
36
37<p>When <SPAN class="argument">mutex</SPAN> is maintained by another thread, the calling thread is suspended until <SPAN class="argument">mutex</SPAN> is released. Note the fact that if the priority of the calling thread is higher than the thread that owns the mutex, the active priority of the thread that owns the mutex will be raised under the basic priority inheritance mechanism of the system.</p>
38
39<p>If <SPAN class="argument">mutex</SPAN> is already saved for the current thread, unnecessary <code>OSLockMutex</code> function calls will return quickly. Note that each <code>OSUnlockMutex</code> function call must correspond to a <code>OSLockMutex</code> function call or the mutex will not be freed. This allows the safe nesting of multiple calls to <code>OSLockMutex</code> and <code>OSUnlockMutex</code> for the same mutex.</p>
40
41<h2>See Also</h2>
42<P class="reference">
43<A href="../toc.html#Thread" target="contents">Thread Functions</A>,
44<A href="../toc.html#ThreadSynchronization" target="contents">Thread Synchronization Functions</A>,
45<a href="OSInitCond.html">OSInitCond</a>,
46<a href="OSInitMutex.html">OSInitMutex</a>,
47<a href="OSSignalCond.html">OSSignalCond</a>,
48<a href="OSTryLockMutex.html">OSTryLockMutex</a>,
49<a href="OSUnlockMutex.html">OSUnlockMutex</a>,
50<a href="OSWaitCond.html">OSWaitCond</a>
51</p>
52
53<h2>Revision History</h2>
54<P>
552006/03/01 Initial version.<br>
56</p>
57
58<hr><p>CONFIDENTIAL</p></body>
59</html>