1 | <?xml version="1.0" encoding="utf-8"?> |
---|
2 | <!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" |
---|
3 | "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd" [ |
---|
4 | <!ENTITY % thread.entities SYSTEM "entities.xml"> |
---|
5 | %thread.entities; |
---|
6 | ]> |
---|
7 | <!-- Copyright (c) 2002-2003 William E. Kempf, Michael Glassford |
---|
8 | Subject to the Boost Software License, Version 1.0. |
---|
9 | (See accompanying file LICENSE-1.0 or http://www.boost.org/LICENSE-1.0) |
---|
10 | --> |
---|
11 | <header name="boost/thread/recursive_mutex.hpp" |
---|
12 | last-revision="$Date: 2006/10/15 14:52:54 $"> |
---|
13 | <namespace name="boost"> |
---|
14 | <class name="recursive_mutex"> |
---|
15 | <purpose> |
---|
16 | <para>The <classname>recursive_mutex</classname> class is a model of the |
---|
17 | <link linkend="thread.concepts.Mutex">Mutex</link> concept.</para> |
---|
18 | </purpose> |
---|
19 | |
---|
20 | <description> |
---|
21 | <para>The <classname>recursive_mutex</classname> class is a model of the |
---|
22 | <link linkend="thread.concepts.Mutex">Mutex</link> concept. |
---|
23 | It should be used to synchronize access to shared resources using |
---|
24 | <link linkend="thread.concepts.recursive-locking-strategy">Recursive</link> |
---|
25 | locking mechanics.</para> |
---|
26 | |
---|
27 | <para>For classes that model related mutex concepts, see |
---|
28 | <classname>recursive_try_mutex</classname> and <classname>recursive_timed_mutex</classname>.</para> |
---|
29 | |
---|
30 | <para>For <link linkend="thread.concepts.unspecified-locking-strategy">Unspecified</link> |
---|
31 | locking mechanics, see <classname>mutex</classname>, |
---|
32 | <classname>try_mutex</classname>, and <classname>timed_mutex</classname>. |
---|
33 | </para> |
---|
34 | |
---|
35 | <para>The <classname>recursive_mutex</classname> class supplies the following typedef, |
---|
36 | which models the specified locking strategy: |
---|
37 | |
---|
38 | <table> |
---|
39 | <title>Supported Lock Types</title> |
---|
40 | <tgroup cols="2" align="left"> |
---|
41 | <thead> |
---|
42 | <row> |
---|
43 | <entry>Lock Name</entry> |
---|
44 | <entry>Lock Concept</entry> |
---|
45 | </row> |
---|
46 | </thead> |
---|
47 | <tbody> |
---|
48 | <row> |
---|
49 | <entry>scoped_lock</entry> |
---|
50 | <entry><link linkend="thread.concepts.ScopedLock">ScopedLock</link></entry> |
---|
51 | </row> |
---|
52 | </tbody> |
---|
53 | </tgroup> |
---|
54 | </table> |
---|
55 | </para> |
---|
56 | |
---|
57 | <para>The <classname>recursive_mutex</classname> class uses a |
---|
58 | <link linkend="thread.concepts.recursive-locking-strategy">Recursive</link> |
---|
59 | locking strategy, so attempts to recursively lock a |
---|
60 | <classname>recursive_mutex</classname> object |
---|
61 | succeed and an internal "lock count" is maintained. |
---|
62 | Attempts to unlock a <classname>recursive_mutex</classname> object |
---|
63 | by threads that don't own a lock on it result in |
---|
64 | <emphasis role="bold">undefined behavior</emphasis>.</para> |
---|
65 | |
---|
66 | <para>Like all |
---|
67 | <link linkend="thread.concepts.mutex-models">mutex models</link> |
---|
68 | in &Boost.Thread;, <classname>recursive_mutex</classname> leaves the |
---|
69 | <link linkend="thread.concepts.sheduling-policies">scheduling policy</link> |
---|
70 | as <link linkend="thread.concepts.unspecified-scheduling-policy">Unspecified</link>. |
---|
71 | Programmers should make no assumptions about the order in which |
---|
72 | waiting threads acquire a lock.</para> |
---|
73 | </description> |
---|
74 | |
---|
75 | <inherit access="private"> |
---|
76 | <type><classname>boost::noncopyable</classname></type> |
---|
77 | <purpose>Exposition only</purpose> |
---|
78 | </inherit> |
---|
79 | |
---|
80 | <typedef name="scoped_lock"> |
---|
81 | <type><emphasis>implementation-defined</emphasis></type> |
---|
82 | </typedef> |
---|
83 | |
---|
84 | <constructor> |
---|
85 | <effects>Constructs a <classname>recursive_mutex</classname> object. |
---|
86 | </effects> |
---|
87 | |
---|
88 | <postconditions><code>*this</code> is in an unlocked state. |
---|
89 | </postconditions> |
---|
90 | </constructor> |
---|
91 | |
---|
92 | <destructor> |
---|
93 | <effects>Destroys a <classname>recursive_mutex</classname> object.</effects> |
---|
94 | |
---|
95 | <requires><code>*this</code> is in an unlocked state.</requires> |
---|
96 | |
---|
97 | <notes><emphasis role="bold">Danger:</emphasis> Destruction of a |
---|
98 | locked mutex is a serious programming error resulting in undefined |
---|
99 | behavior such as a program crash.</notes> |
---|
100 | </destructor> |
---|
101 | </class> |
---|
102 | |
---|
103 | <class name="recursive_try_mutex"> |
---|
104 | <purpose> |
---|
105 | <para>The <classname>recursive_try_mutex</classname> class is a model of the |
---|
106 | <link linkend="thread.concepts.TryMutex">TryMutex</link> concept.</para> |
---|
107 | </purpose> |
---|
108 | |
---|
109 | <description> |
---|
110 | <para>The <classname>recursive_try_mutex</classname> class is a model of the |
---|
111 | <link linkend="thread.concepts.TryMutex">TryMutex</link> concept. |
---|
112 | It should be used to synchronize access to shared resources using |
---|
113 | <link linkend="thread.concepts.recursive-locking-strategy">Recursive</link> |
---|
114 | locking mechanics.</para> |
---|
115 | |
---|
116 | <para>For classes that model related mutex concepts, see |
---|
117 | <classname>recursive_mutex</classname> and <classname>recursive_timed_mutex</classname>.</para> |
---|
118 | |
---|
119 | <para>For <link linkend="thread.concepts.unspecified-locking-strategy">Unspecified</link> |
---|
120 | locking mechanics, see <classname>mutex</classname>, |
---|
121 | <classname>try_mutex</classname>, and <classname>timed_mutex</classname>. |
---|
122 | </para> |
---|
123 | |
---|
124 | <para>The <classname>recursive_try_mutex</classname> class supplies the following typedefs, |
---|
125 | which model the specified locking strategies: |
---|
126 | |
---|
127 | <table> |
---|
128 | <title>Supported Lock Types</title> |
---|
129 | <tgroup cols="2" align="left"> |
---|
130 | <thead> |
---|
131 | <row> |
---|
132 | <entry>Lock Name</entry> |
---|
133 | <entry>Lock Concept</entry> |
---|
134 | </row> |
---|
135 | </thead> |
---|
136 | <tbody> |
---|
137 | <row> |
---|
138 | <entry>scoped_lock</entry> |
---|
139 | <entry><link linkend="thread.concepts.ScopedLock">ScopedLock</link></entry> |
---|
140 | </row> |
---|
141 | <row> |
---|
142 | <entry>scoped_try_lock</entry> |
---|
143 | <entry><link linkend="thread.concepts.ScopedTryLock">ScopedTryLock</link></entry> |
---|
144 | </row> |
---|
145 | </tbody> |
---|
146 | </tgroup> |
---|
147 | </table> |
---|
148 | </para> |
---|
149 | |
---|
150 | <para>The <classname>recursive_try_mutex</classname> class uses a |
---|
151 | <link linkend="thread.concepts.recursive-locking-strategy">Recursive</link> |
---|
152 | locking strategy, so attempts to recursively lock a |
---|
153 | <classname>recursive_try_mutex</classname> object |
---|
154 | succeed and an internal "lock count" is maintained. |
---|
155 | Attempts to unlock a <classname>recursive_mutex</classname> object |
---|
156 | by threads that don't own a lock on it result in |
---|
157 | <emphasis role="bold">undefined behavior</emphasis>.</para> |
---|
158 | |
---|
159 | <para>Like all |
---|
160 | <link linkend="thread.concepts.mutex-models">mutex models</link> |
---|
161 | in &Boost.Thread;, <classname>recursive_try_mutex</classname> leaves the |
---|
162 | <link linkend="thread.concepts.sheduling-policies">scheduling policy</link> |
---|
163 | as <link linkend="thread.concepts.unspecified-scheduling-policy">Unspecified</link>. |
---|
164 | Programmers should make no assumptions about the order in which |
---|
165 | waiting threads acquire a lock.</para> |
---|
166 | </description> |
---|
167 | |
---|
168 | <inherit access="private"> |
---|
169 | <type><classname>boost::noncopyable</classname></type> |
---|
170 | <purpose>Exposition only</purpose> |
---|
171 | </inherit> |
---|
172 | |
---|
173 | <typedef name="scoped_lock"> |
---|
174 | <type><emphasis>implementation-defined</emphasis></type> |
---|
175 | </typedef> |
---|
176 | |
---|
177 | <typedef name="scoped_try_lock"> |
---|
178 | <type><emphasis>implementation-defined</emphasis></type> |
---|
179 | </typedef> |
---|
180 | |
---|
181 | <constructor> |
---|
182 | <effects>Constructs a <classname>recursive_try_mutex</classname> object. |
---|
183 | </effects> |
---|
184 | |
---|
185 | <postconditions><code>*this</code> is in an unlocked state. |
---|
186 | </postconditions> |
---|
187 | </constructor> |
---|
188 | |
---|
189 | <destructor> |
---|
190 | <effects>Destroys a <classname>recursive_try_mutex</classname> object. |
---|
191 | </effects> |
---|
192 | |
---|
193 | <requires><code>*this</code> is in an unlocked state.</requires> |
---|
194 | |
---|
195 | <notes><emphasis role="bold">Danger:</emphasis> Destruction of a |
---|
196 | locked mutex is a serious programming error resulting in undefined |
---|
197 | behavior such as a program crash.</notes> |
---|
198 | </destructor> |
---|
199 | </class> |
---|
200 | |
---|
201 | <class name="recursive_timed_mutex"> |
---|
202 | <purpose> |
---|
203 | <para>The <classname>recursive_timed_mutex</classname> class is a model of the |
---|
204 | <link linkend="thread.concepts.TimedMutex">TimedMutex</link> concept.</para> |
---|
205 | </purpose> |
---|
206 | |
---|
207 | <description> |
---|
208 | <para>The <classname>recursive_timed_mutex</classname> class is a model of the |
---|
209 | <link linkend="thread.concepts.TimedMutex">TimedMutex</link> concept. |
---|
210 | It should be used to synchronize access to shared resources using |
---|
211 | <link linkend="thread.concepts.recursive-locking-strategy">Recursive</link> |
---|
212 | locking mechanics.</para> |
---|
213 | |
---|
214 | <para>For classes that model related mutex concepts, see |
---|
215 | <classname>recursive_mutex</classname> and <classname>recursive_try_mutex</classname>.</para> |
---|
216 | |
---|
217 | <para>For <link linkend="thread.concepts.unspecified-locking-strategy">Unspecified</link> |
---|
218 | locking mechanics, see <classname>mutex</classname>, |
---|
219 | <classname>try_mutex</classname>, and <classname>timed_mutex</classname>. |
---|
220 | </para> |
---|
221 | |
---|
222 | <para>The <classname>recursive_timed_mutex</classname> class supplies the following typedefs, |
---|
223 | which model the specified locking strategies: |
---|
224 | |
---|
225 | <table> |
---|
226 | <title>Supported Lock Types</title> |
---|
227 | <tgroup cols="2" align="left"> |
---|
228 | <thead> |
---|
229 | <row> |
---|
230 | <entry>Lock Name</entry> |
---|
231 | <entry>Lock Concept</entry> |
---|
232 | </row> |
---|
233 | </thead> |
---|
234 | <tbody> |
---|
235 | <row> |
---|
236 | <entry>scoped_lock</entry> |
---|
237 | <entry><link linkend="thread.concepts.ScopedLock">ScopedLock</link></entry> |
---|
238 | </row> |
---|
239 | <row> |
---|
240 | <entry>scoped_try_lock</entry> |
---|
241 | <entry><link linkend="thread.concepts.ScopedTryLock">ScopedTryLock</link></entry> |
---|
242 | </row> |
---|
243 | <row> |
---|
244 | <entry>scoped_timed_lock</entry> |
---|
245 | <entry><link linkend="thread.concepts.ScopedTimedLock">ScopedTimedLock</link></entry> |
---|
246 | </row> |
---|
247 | </tbody> |
---|
248 | </tgroup> |
---|
249 | </table> |
---|
250 | </para> |
---|
251 | |
---|
252 | <para>The <classname>recursive_timed_mutex</classname> class uses a |
---|
253 | <link linkend="thread.concepts.recursive-locking-strategy">Recursive</link> |
---|
254 | locking strategy, so attempts to recursively lock a |
---|
255 | <classname>recursive_timed_mutex</classname> object |
---|
256 | succeed and an internal "lock count" is maintained. |
---|
257 | Attempts to unlock a <classname>recursive_mutex</classname> object |
---|
258 | by threads that don't own a lock on it result in |
---|
259 | <emphasis role="bold">undefined behavior</emphasis>.</para> |
---|
260 | |
---|
261 | <para>Like all |
---|
262 | <link linkend="thread.concepts.mutex-models">mutex models</link> |
---|
263 | in &Boost.Thread;, <classname>recursive_timed_mutex</classname> leaves the |
---|
264 | <link linkend="thread.concepts.sheduling-policies">scheduling policy</link> |
---|
265 | as <link linkend="thread.concepts.unspecified-scheduling-policy">Unspecified</link>. |
---|
266 | Programmers should make no assumptions about the order in which |
---|
267 | waiting threads acquire a lock.</para> |
---|
268 | </description> |
---|
269 | |
---|
270 | <inherit access="private"> |
---|
271 | <type><classname>boost::noncopyable</classname></type> |
---|
272 | <purpose>Exposition only</purpose> |
---|
273 | </inherit> |
---|
274 | |
---|
275 | <typedef name="scoped_lock"> |
---|
276 | <type><emphasis>implementation-defined</emphasis></type> |
---|
277 | </typedef> |
---|
278 | |
---|
279 | <typedef name="scoped_try_lock"> |
---|
280 | <type><emphasis>implementation-defined</emphasis></type> |
---|
281 | </typedef> |
---|
282 | |
---|
283 | <typedef name="scoped_timed_lock"> |
---|
284 | <type><emphasis>implementation-defined</emphasis></type> |
---|
285 | </typedef> |
---|
286 | |
---|
287 | <constructor> |
---|
288 | <effects>Constructs a <classname>recursive_timed_mutex</classname> object. |
---|
289 | </effects> |
---|
290 | |
---|
291 | <postconditions><code>*this</code> is in an unlocked state. |
---|
292 | </postconditions> |
---|
293 | </constructor> |
---|
294 | |
---|
295 | <destructor> |
---|
296 | <effects>Destroys a <classname>recursive_timed_mutex</classname> object.</effects> |
---|
297 | |
---|
298 | <requires><code>*this</code> is in an unlocked state.</requires> |
---|
299 | |
---|
300 | <notes><emphasis role="bold">Danger:</emphasis> Destruction of a |
---|
301 | locked mutex is a serious programming error resulting in undefined |
---|
302 | behavior such as a program crash.</notes> |
---|
303 | </destructor> |
---|
304 | </class> |
---|
305 | </namespace> |
---|
306 | </header> |
---|