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="IBM WebSphere Studio Homepage Builder Version 7.0.1.0 for Windows">
7<META http-equiv="Content-Style-Type" content="text/css">
8<title>OS_TryLockMutex[R|W]</title>
9<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css">
10</head>
11
12<body>
13
14<h1 align="left">OS_TryLockMutex[R|W] <IMG src="../../image/NTR.gif" align="middle"><IMG src="../../image/TWL.gif" align="middle"></h1>
15<h2>Syntax</h2>
16
17<dl>
18  <dd>
19<CODE>#include &lt;nitro/os.h&gt;</CODE><BR> <BR> <CODE>BOOL OS_TryLockMutexR( OSMutex* mutex );</CODE><BR> <BR> <CODE>BOOL OS_TryLockMutexW( OSMutex* mutex );</CODE></dd>
20</dl>
21
22<h2>Arguments</h2>
23<TABLE border="1" width="100%">
24  <TBODY>
25    <TR>
26      <TD width="13%"><CODE>mutex</CODE></TD>
27      <TD width="87%">Pointer to the <CODE>OSMutex</CODE> structure</TD>
28    </TR>
29  </TBODY>
30</TABLE>
31
32<h2>Return Values</h2>
33<p>Returns TRUE when <CODE>mutex</CODE> is locked. Otherwise returns FALSE.</p>
34
35<H2>Description</H2>
36<P>The calling thread attempts to lock <CODE>mutex</CODE>.</P>
37<P><CODE>mutex</CODE> is the pointer to the <CODE>OSMutex</CODE> structure to be changed.</P>
38<P>The <CODE>OS_TryLockMutexR</CODE> function tries to <CODE>read lock</CODE> the mutex. The <CODE>OS_TryLockMutexW</CODE> function tries to <CODE>write lock</CODE> the mutex. To read how these two functions differ, see the <CODE><A href="OS_LockMutexRW.html">OS_LockMutexR/OS_LockMutexW</A></CODE> functions.</P>
39<P>If the mutex cannot be locked, the function returns <code>FALSE</code>. If the mutex can be locked, the <CODE>OS_TryLockMutexR</CODE> function conforms to the process of the <A href="OS_LockMutexRW.html"><CODE>OS_LockMutexR</CODE></A> function, and the <CODE>OS_TryLockMutexW</CODE> function conforms to the process of the <CODE><A href="OS_LockMutexRW.html">OS_LockMutexW</A></CODE> function.</P>
40
41<h2>See Also</h2>
42<p><CODE><A href="OS_InitMutex.html">OS_InitMutex</A><BR> <A href="OS_LockMutex.html">OS_LockMutex</A><BR> <A href="OS_UnlockMutex.html">OS_UnlockMutex</A><BR> <A href="OS_LockMutexRW.html">OS_LockMutexR</A><BR> <A href="OS_LockMutexRW.html">OS_LockMutexW</A><BR> <A href="OS_UnlockMutexRW.html">OS_UnlocMutexR</A><BR> <A href="OS_UnlockMutexRW.html">OS_UnlocMutexW</A><BR> <A href="OS_LockMutexFromToRW.html">OS_LockMutexFromRToW</A><BR> <A href="OS_LockMutexFromToRW.html">OS_LockMutexFromWToR</A><BR> <A href="OS_TryLockMutexFromToRW.html">OS_TryLockMutexFromRToW</A><BR> <A href="OS_TryLockMutexFromToRW.html">OS_TryLockMutexFromWToR</A></CODE></p>
43
44<H2>Revision History</H2>
45<P>2008/12/16 Initial version.</P>
46<hr><p>CONFIDENTIAL</p></body>
47</html>
48