Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/doc/html/boost/recursive_timed_mutex.html @ 29

Last change on this file since 29 was 29, checked in by landauf, 17 years ago

updated boost from 1_33_1 to 1_34_1

File size: 9.1 KB
Line 
1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
4<title>Class recursive_timed_mutex</title>
5<link rel="stylesheet" href="../boostbook.css" type="text/css">
6<meta name="generator" content="DocBook XSL Stylesheets V1.68.1">
7<link rel="start" href="../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
8<link rel="up" href="../thread/reference.html#header.boost.thread.recursive_mutex.hpp" title="Header &lt;boost/thread/recursive_mutex.hpp&gt;">
9<link rel="prev" href="recursive_try_mutex.html" title="Class recursive_try_mutex">
10<link rel="next" href="read_write_scheduling_policy/read_write_scheduling_policy.html" title="Type read_write_scheduling_policy">
11</head>
12<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13<table cellpadding="2" width="100%">
14<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../boost.png"></td>
15<td align="center"><a href="../../../index.htm">Home</a></td>
16<td align="center"><a href="../../../libs/libraries.htm">Libraries</a></td>
17<td align="center"><a href="../../../people/people.htm">People</a></td>
18<td align="center"><a href="../../../more/faq.htm">FAQ</a></td>
19<td align="center"><a href="../../../more/index.htm">More</a></td>
20</table>
21<hr>
22<div class="spirit-nav">
23<a accesskey="p" href="recursive_try_mutex.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../thread/reference.html#header.boost.thread.recursive_mutex.hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="read_write_scheduling_policy/read_write_scheduling_policy.html"><img src="../images/next.png" alt="Next"></a>
24</div>
25<div class="refentry" lang="en">
26<a name="boost.recursive_timed_mutex"></a><div class="titlepage"></div>
27<div class="refnamediv">
28<h2><span class="refentrytitle">Class recursive_timed_mutex</span></h2>
29<p>boost::recursive_timed_mutex &#8212; <p>The <a href="recursive_timed_mutex.html" title="Class recursive_timed_mutex">recursive_timed_mutex</a> class is a model of the
30                        <a href="../thread/concepts.html#thread.concepts.TimedMutex" title="TimedMutex Concept">TimedMutex</a> concept.</p></p>
31</div>
32<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
33<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
34<span class="bold"><strong>class</strong></span> recursive_timed_mutex : <span class="bold"><strong>private</strong></span> boost::noncopyable   <span class="emphasis"><em>// Exposition only</em></span>
35{
36<span class="bold"><strong>public</strong></span>:
37  <span class="emphasis"><em>// types</em></span>
38  <span class="bold"><strong>typedef</strong></span> <span class="emphasis"><em>implementation-defined</em></span> scoped_lock;      
39  <span class="bold"><strong>typedef</strong></span> <span class="emphasis"><em>implementation-defined</em></span> scoped_try_lock;  
40  <span class="bold"><strong>typedef</strong></span> <span class="emphasis"><em>implementation-defined</em></span> scoped_timed_lock;
41
42  <span class="emphasis"><em>// <a href="recursive_timed_mutex.html#boost.recursive_timed_mutexconstruct-copy-destruct">construct/copy/destruct</a></em></span>
43  <a href="recursive_timed_mutex.html#id1286101-bb">recursive_timed_mutex</a>();
44  <a href="recursive_timed_mutex.html#id872144-bb">~recursive_timed_mutex</a>();
45};</pre></div>
46<div class="refsect1" lang="en">
47<a name="id1741238"></a><h2>Description</h2>
48<p>The <a href="recursive_timed_mutex.html" title="Class recursive_timed_mutex">recursive_timed_mutex</a> class is a model of the
49                        <a href="../thread/concepts.html#thread.concepts.TimedMutex" title="TimedMutex Concept">TimedMutex</a> concept.
50                        It should be used to synchronize access to shared resources using
51                        <a href="../thread/concepts.html#thread.concepts.recursive-locking-strategy" title="Recursive Locking Strategy">Recursive</a>
52                        locking mechanics.</p>
53<p>For classes that model related mutex concepts, see
54                        <a href="recursive_mutex.html" title="Class recursive_mutex">recursive_mutex</a> and <a href="recursive_try_mutex.html" title="Class recursive_try_mutex">recursive_try_mutex</a>.</p>
55<p>For <a href="../thread/concepts.html#thread.concepts.unspecified-locking-strategy" title="Unspecified Locking Strategy">Unspecified</a>
56                        locking mechanics, see <a href="mutex.html" title="Class mutex">mutex</a>,
57                        <a href="try_mutex.html" title="Class try_mutex">try_mutex</a>, and <a href="timed_mutex.html" title="Class timed_mutex">timed_mutex</a>.
58                        </p>
59<p>The <a href="recursive_timed_mutex.html" title="Class recursive_timed_mutex">recursive_timed_mutex</a> class supplies the following typedefs,
60                        which model the specified locking strategies:
61
62                        </p>
63<div class="table">
64<a name="id1741335"></a><p class="title"><b>Table 15.25. Supported Lock Types</b></p>
65<table class="table" summary="Supported Lock Types">
66<colgroup>
67<col>
68<col>
69</colgroup>
70<thead><tr>
71<th align="left">Lock Name</th>
72<th align="left">Lock Concept</th>
73</tr></thead>
74<tbody>
75<tr>
76<td align="left">scoped_lock</td>
77<td align="left"><a href="../thread/concepts.html#thread.concepts.ScopedLock" title="ScopedLock Concept">ScopedLock</a></td>
78</tr>
79<tr>
80<td align="left">scoped_try_lock</td>
81<td align="left"><a href="../thread/concepts.html#thread.concepts.ScopedTryLock" title="ScopedTryLock Concept">ScopedTryLock</a></td>
82</tr>
83<tr>
84<td align="left">scoped_timed_lock</td>
85<td align="left"><a href="../thread/concepts.html#thread.concepts.ScopedTimedLock" title="ScopedTimedLock Concept">ScopedTimedLock</a></td>
86</tr>
87</tbody>
88</table>
89</div>
90<p>
91                        </p>
92<p>The <a href="recursive_timed_mutex.html" title="Class recursive_timed_mutex">recursive_timed_mutex</a> class uses a
93                        <a href="../thread/concepts.html#thread.concepts.recursive-locking-strategy" title="Recursive Locking Strategy">Recursive</a>
94                        locking strategy, so attempts to recursively lock a
95                        <a href="recursive_timed_mutex.html" title="Class recursive_timed_mutex">recursive_timed_mutex</a> object
96                        succeed and an internal "lock count" is maintained.
97                        Attempts to unlock a <a href="recursive_mutex.html" title="Class recursive_mutex">recursive_mutex</a> object
98                        by threads that don't own a lock on it result in
99                        <span class="bold"><strong>undefined behavior</strong></span>.</p>
100<p>Like all
101                        <a href="../thread/concepts.html#thread.concepts.mutex-models" title="Mutex Models">mutex models</a>
102                        in  <span class="bold"><strong>Boost.Thread</strong></span>, <a href="recursive_timed_mutex.html" title="Class recursive_timed_mutex">recursive_timed_mutex</a> leaves the
103                        <a href="../thread/concepts.html#thread.concepts.sheduling-policies" title="Scheduling Policies">scheduling policy</a>
104                        as <a href="../thread/concepts.html#thread.concepts.unspecified-scheduling-policy" title="Unspecified Policy">Unspecified</a>.
105                        Programmers should make no assumptions about the order in which
106                        waiting threads acquire a lock.</p>
107<div class="refsect2" lang="en">
108<a name="id1741499"></a><h3>
109<a name="boost.recursive_timed_mutexconstruct-copy-destruct"></a><code class="computeroutput">recursive_timed_mutex</code> construct/copy/destruct</h3>
110<div class="orderedlist"><ol type="1">
111<li>
112<pre class="literallayout"><a name="id1286101-bb"></a>recursive_timed_mutex();</pre>
113<div class="variablelist"><table border="0">
114<col align="left" valign="top">
115<tbody>
116<tr>
117<td>
118<span class="term">Effects:</span></td>
119<td>Constructs a <a href="recursive_timed_mutex.html" title="Class recursive_timed_mutex">recursive_timed_mutex</a> object.
120                        </td>
121</tr>
122<tr>
123<td>
124<span class="term">Postconditions:</span></td>
125<td>
126<code class="computeroutput">*this</code> is in an unlocked state.
127                        </td>
128</tr>
129</tbody>
130</table></div>
131</li>
132<li>
133<pre class="literallayout"><a name="id872144-bb"></a>~recursive_timed_mutex();</pre>
134<div class="variablelist"><table border="0">
135<col align="left" valign="top">
136<tbody>
137<tr>
138<td>
139<span class="term">Effects:</span></td>
140<td>Destroys a <a href="recursive_timed_mutex.html" title="Class recursive_timed_mutex">recursive_timed_mutex</a> object.</td>
141</tr>
142<tr>
143<td>
144<span class="term">Requires:</span></td>
145<td>
146<code class="computeroutput">*this</code> is in an unlocked state.</td>
147</tr>
148<tr>
149<td>
150<span class="term">Notes:</span></td>
151<td>
152<span class="bold"><strong>Danger:</strong></span> Destruction of a
153                        locked mutex is a serious programming error resulting in undefined
154                        behavior such as a program crash.</td>
155</tr>
156</tbody>
157</table></div>
158</li>
159</ol></div>
160</div>
161</div>
162</div>
163<table width="100%"><tr>
164<td align="left"></td>
165<td align="right"><small>Copyright © 2001-2003 William E. Kempf</small></td>
166</tr></table>
167<hr>
168<div class="spirit-nav">
169<a accesskey="p" href="recursive_try_mutex.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../thread/reference.html#header.boost.thread.recursive_mutex.hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="read_write_scheduling_policy/read_write_scheduling_policy.html"><img src="../images/next.png" alt="Next"></a>
170</div>
171</body>
172</html>
Note: See TracBrowser for help on using the repository browser.