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