Author: alai04 Date: Sun Apr 19 20:16:56 2009 New Revision: 243 Modified: trunk/doc/html/thread.html trunk/doc/html/thread/changes.html trunk/doc/html/thread/synchronization.html trunk/doc/html/thread/thread_local_storage.html trunk/doc/html/thread/thread_management.html trunk/doc/html/thread/time.html trunk/libs/libraries.htm Log: 修复升级至1.38.0版本时对 thread 译文的错误覆 Modified: trunk/doc/html/thread.html ============================================================================== --- trunk/doc/html/thread.html (original) +++ trunk/doc/html/thread.html Sun Apr 19 20:16:56 2009 @@ -1,114 +1,100 @@ -<html> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> -<title>Chapter 19. Thread</title> -<link rel="stylesheet" href="boostbook.css" type="text/css"> -<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">-<link rel="start" href="index.html" title="The Boost C++ Libraries BoostBook Documentation Subset"> -<link rel="up" href="libraries.html" title="Part I. The Boost C++ Libraries (BoostBook Subset)">
-<link rel="prev" href="string_algo/credits.html" title="Credits">-<link rel="next" href="thread/changes.html" title="Changes since boost 1.35">
-</head>-<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table cellpadding="2" width="100%"><tr>-<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../boost.png"></td>
-<td align="center"><a href="../../index.html">Home</a></td> -<td align="center"><a href="../../libs/libraries.htm">Libraries</a></td>-<td align="center"><a href="http://www.boost.org/users/people.html";>People</a></td> -<td align="center"><a href="http://www.boost.org/users/faq.html";>FAQ</a></td>
-<td align="center"><a href="../../more/index.htm">More</a></td> -</tr></table> -<hr> -<div class="spirit-nav">-<a accesskey="p" href="string_algo/credits.html"><img src="../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="libraries.html"><img src="../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="thread/changes.html"><img src="../../doc/html/images/next.png" alt="Next"></a>
-</div> -<div class="chapter" lang="en"> -<div class="titlepage"><div> -<div><h2 class="title"> -<a name="thread"></a>Chapter 19. Thread</h2></div> -<div><div class="authorgroup"><div class="author"><h3 class="author">-<span class="firstname">Anthony</span> <span class="surname">Williams</span>
-</h3></div></div></div> -<div><p class="copyright">Copyright 2007 -8 Anthony Williams</p></div> -<div><div class="legalnotice"> -<a name="id4040732"></a><p>- Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt"; target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
- </p> -</div></div> -</div></div> -<div class="toc"> -<p><b>Table of Contents</b></p> -<dl>-<dt><span class="section"><a href="thread.html#thread.overview"> Overview</a></span></dt> -<dt><span class="section"><a href="thread/changes.html"> Changes since boost 1.35</a></span></dt> -<dt><span class="section"><a href="thread/thread_management.html"> Thread Management</a></span></dt>
-<dd><dl>-<dt><span class="section"><a href="thread/thread_management.html#thread.thread_management.thread"> Class <code class="computeroutput"><span class="identifier">thread</span></code></a></span></dt> -<dt><span class="section"><a href="thread/thread_management.html#thread.thread_management.this_thread"> Namespace <code class="computeroutput"><span class="identifier">this_thread</span></code></a></span></dt> -<dt><span class="section"><a href="thread/thread_management.html#thread.thread_management.threadgroup"> Class <code class="computeroutput"><span class="identifier">thread_group</span></code></a></span></dt>
-</dl></dd>-<dt><span class="section"><a href="thread/synchronization.html"> Synchronization</a></span></dt>
-<dd><dl>-<dt><span class="section"><a href="thread/synchronization.html#thread.synchronization.mutex_concepts"> Mutex Concepts</a></span></dt> -<dt><span class="section"><a href="thread/synchronization.html#thread.synchronization.locks"> Lock Types</a></span></dt> -<dt><span class="section"><a href="thread/synchronization.html#thread.synchronization.lock_functions"> Lock functions</a></span></dt> -<dt><span class="section"><a href="thread/synchronization.html#thread.synchronization.mutex_types"> Mutex Types</a></span></dt> -<dt><span class="section"><a href="thread/synchronization.html#thread.synchronization.condvar_ref"> Condition Variables</a></span></dt> -<dt><span class="section"><a href="thread/synchronization.html#thread.synchronization.once"> One-time Initialization</a></span></dt> -<dt><span class="section"><a href="thread/synchronization.html#thread.synchronization.barriers"> Barriers</a></span></dt>
-</dl></dd>-<dt><span class="section"><a href="thread/thread_local_storage.html">Thread Local Storage</a></span></dt> -<dd><dl><dt><span class="section"><a href="thread/thread_local_storage.html#thread.thread_local_storage.thread_specific_ptr"> Class - <code class="computeroutput"><span class="identifier">thread_specific_ptr</span></code></a></span></dt></dl></dd> -<dt><span class="section"><a href="thread/time.html"> Date and Time Requirements</a></span></dt>
-<dd><dl>-<dt><span class="section"><a href="thread/time.html#thread.time.system_time"> Typedef <code class="computeroutput"><span class="identifier">system_time</span></code></a></span></dt> -<dt><span class="section"><a href="thread/time.html#thread.time.get_system_time"> Non-member function <code class="computeroutput"><span class="identifier">get_system_time</span><span class="special">()</span></code></a></span></dt>
-</dl></dd>-<dt><span class="section"><a href="thread/acknowledgements.html"> Acknowledgments</a></span></dt>
-</dl> -</div> -<div class="section" lang="en"> -<div class="titlepage"><div><div><h2 class="title" style="clear: both">-<a name="thread.overview"></a><a class="link" href="thread.html#thread.overview" title="Overview"> Overview</a>
-</h2></div></div></div> -<p>- <span class="bold"><strong>Boost.Thread</strong></span> enables the use of multiple threads - of execution with shared data in portable C++ code. It provides classes and - functions for managing the threads themselves, along with others for synchronizing - data between the threads or providing separate copies of data specific to individual
- threads. - </p> -<p>- The <span class="bold"><strong>Boost.Thread</strong></span> library was originally written - and designed by William E. Kempf. This version is a major rewrite designed - to closely follow the proposals presented to the C++ Standards Committee, in - particular <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2497.html"; target="_top">N2497</a>, - <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2320.html"; target="_top">N2320</a>, - <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2184.html"; target="_top">N2184</a>, - <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2139.html"; target="_top">N2139</a>, - and <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2094.html"; target="_top">N2094</a>
- </p> -<p>- In order to use the classes and functions described here, you can either include - the specific headers specified by the descriptions of each class or function,
- or include the master thread library header: - </p>-<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">thread</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
-</pre> -<p> - which includes all the other headers in turn. - </p> -</div> -</div>-<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"; width="100%"><tr>
-<td align="left"></td> -<td align="right"><div class="copyright-footer"></div></td> -</tr></table> -<hr> -<div class="spirit-nav">-<a accesskey="p" href="string_algo/credits.html"><img src="../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="libraries.html"><img src="../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="thread/changes.html"><img src="../../doc/html/images/next.png" alt="Next"></a>
-</div> -</body> -</html> +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> ++<title>Chapter 19. Thread</title><link rel="stylesheet" href="boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">+<link rel="start" href="index.html" title="The Boost C++ Libraries BoostBook Documentation Subset"> +<link rel="up" href="libraries.html" title="Part I. The Boost C++ Libraries (BoostBook Subset)">
+<link rel="prev" href="string_algo/credits.html" title="Credits">+<link rel="next" href="thread/changes.html" title="Changes since boost 1.35"></head> +<body alink="#0000ff" bgcolor="white" link="#0000ff" text="black" vlink="#840084">
+<table cellpadding="2" width="100%"><tbody><tr>+<td valign="top"><img alt="Boost C++ Libraries" src="../../boost.png" height="86" width="277"></td>
+<td align="center"><a href="../../index.html">Home</a></td> +<td align="center"><a href="../../libs/libraries.htm">Libraries</a></td>+<td align="center"><a href="http://www.boost.org/users/people.html";>People</a></td> +<td align="center"><a href="http://www.boost.org/users/faq.html";>FAQ</a></td>
+<td align="center"><a href="../../more/index.htm">More</a></td> +</tr></tbody></table> +<hr> +<div class="spirit-nav">+<a accesskey="p" href="string_algo/credits.html"><img src="../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="libraries.html"><img src="../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="thread/changes.html"><img src="../../doc/html/images/next.png" alt="Next"></a>
+</div> +<div class="chapter" lang="en"> +<div class="titlepage"><div> +<div><h2 class="title"> +<a name="thread"></a>Chapter 19. Thread</h2></div> +<div><div class="authorgroup"><div class="author"><h3 class="author">+<span class="firstname">Anthony</span> <span class="surname">Williams</span>
+</h3></div></div></div> +<div><p class="copyright">Copyright (c) 2007 -8 Anthony Williams</p></div> +<div><div class="legalnotice"> +<a name="id3714602"></a><p>+ Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt"; target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
+ </p> +</div></div> +</div></div> +<div class="toc"> +<p><b>Table of Contents 目录</b></p> +<dl>+<dt><span class="section"><a href="thread.html#thread.overview"> Overview 简介</a></span></dt> +<dt><span class="section"><a href="thread/changes.html"> Changes since boost 1.35 boost 1.35后的变化</a></span></dt> +<dt><span class="section"><a href="thread/thread_management.html"> Thread Management 线程管理</a></span></dt>
+<dd><dl>+<dt><span class="section"><a href="thread/thread_management.html#thread.thread_management.thread"> Class <code class="computeroutput"><span class="identifier">thread</span></code></a></span></dt> +<dt><span class="section"><a href="thread/thread_management.html#thread.thread_management.this_thread"> Namespace <code class="computeroutput"><span class="identifier">this_thread</span></code></a></span></dt> +<dt><span class="section"><a href="thread/thread_management.html#thread.thread_management.threadgroup"> Class <code class="computeroutput"><span class="identifier">thread_group</span></code></a></span></dt>
+</dl></dd>+<dt><span class="section"><a href="thread/synchronization.html"> Synchronization 同步处理</a></span></dt>
+<dd><dl>+<dt><span class="section"><a href="thread/synchronization.html#thread.synchronization.mutex_concepts"> Mutex Concepts 互斥量概念</a></span></dt> +<dt><span class="section"><a href="thread/synchronization.html#thread.synchronization.locks"> Lock Types 锁定类型</a></span></dt> +<dt><span class="section"><a href="thread/synchronization.html#thread.synchronization.lock_functions"> Lock functions 锁定函数</a></span></dt> +<dt><span class="section"><a href="thread/synchronization.html#thread.synchronization.mutex_types"> Mutex Types 互斥量类型</a></span></dt> +<dt><span class="section"><a href="thread/synchronization.html#thread.synchronization.condvar_ref"> Condition Variables 条件变量</a></span></dt> +<dt><span class="section"><a href="thread/synchronization.html#thread.synchronization.once"> One-time Initialization 一次性初始化</a></span></dt> +<dt><span class="section"><a href="thread/synchronization.html#thread.synchronization.barriers"> Barriers 栏栅</a></span></dt>
+</dl></dd>+<dt><span class="section"><a href="thread/thread_local_storage.html">Thread Local Storage 线程局部存储 </a></span></dt> +<dd><dl><dt><span class="section"><a href="thread/thread_local_storage.html#thread.thread_local_storage.thread_specific_ptr"> Class + <code class="computeroutput"><span class="identifier">thread_specific_ptr</span></code></a></span></dt></dl></dd> +<dt><span class="section"><a href="thread/time.html"> Date and Time Requirements 日期和时间相关</a></span></dt>
+<dd><dl>+<dt><span class="section"><a href="thread/time.html#thread.time.system_time"> Typedef <code class="computeroutput"><span class="identifier">system_time</span></code></a></span></dt> +<dt><span class="section"><a href="thread/time.html#thread.time.get_system_time"> Non-member function <code class="computeroutput"><span class="identifier">get_system_time</span><span class="special">()</span></code></a></span></dt>
+</dl></dd>+<dt><span class="section"><a href="thread/acknowledgements.html"> Acknowledgments 鸣谢</a></span></dt>
+</dl> +</div> +<div class="section" lang="en"> +<div class="titlepage"><div><div><h2 class="title" style="clear: both;">+<a name="thread.overview"></a><a class="link" href="thread.html#thread.overview" title="Overview"> Overview 简介</a>
+</h2></div></div></div> +<p>+ <span class="bold"><strong>Boost.Thread</strong></span> 使我们能够在 可移植的C++代码中使用带有共享数据的多线程执行。它提供了一些类和函数来管理线 程,以及在线程间同步数据或者为每个线程提供独立的数据拷贝。
+ </p> +<p>+ <span class="bold"><strong>Boost.Thread</strong></span> 库起初是由 William E. Kempf 设计和实现的。这个版本进行了大量重写以紧随C++标准委员会所发 布的建议,尤其是 <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2497.html"; target="_top">N2497</a>, + <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2320.html"; target="_top">N2320</a>, + <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2184.html"; target="_top">N2184</a>, + <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2139.html"; target="_top">N2139</a>, 和 <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2094.html"; target="_top">N2094</a>
+ </p>+<p>为了使用在此文档中所介绍的类和函数,你要么包含在每个类或函数的说明中所指 定的特定头文件,要么包含这个线程库的主头文件:
+ </p>+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">thread</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+</pre> +<p>该头文件将转而包含所有其它头文件。 + </p> +</div> +</div>+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"; width="100%"><tbody><tr>
+<td align="left"></td> +<td align="right"><div class="copyright-footer"></div></td> +</tr></tbody></table> +<hr> +<div class="spirit-nav">+<a accesskey="p" href="string_algo/credits.html"><img src="../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="libraries.html"><img src="../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="thread/changes.html"><img src="../../doc/html/images/next.png" alt="Next"></a>
+</div> +</body></html> \ No newline at end of file Modified: trunk/doc/html/thread/changes.html ============================================================================== --- trunk/doc/html/thread/changes.html (original) +++ trunk/doc/html/thread/changes.html Sun Apr 19 20:16:56 2009 @@ -1,194 +1,103 @@ -<html> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> -<title>Changes since boost 1.35</title> -<link rel="stylesheet" href="../boostbook.css" type="text/css"> -<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">-<link rel="start" href="../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
-<link rel="up" href="../thread.html" title="Chapter 19. Thread"> -<link rel="prev" href="../thread.html" title="Chapter 19. Thread"> -<link rel="next" href="thread_management.html" title="Thread Management"> -</head>-<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table cellpadding="2" width="100%"><tr>-<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../boost.png"></td>
-<td align="center"><a href="../../../index.html">Home</a></td> -<td align="center"><a href="../../../libs/libraries.htm">Libraries</a></td>-<td align="center"><a href="http://www.boost.org/users/people.html";>People</a></td> -<td align="center"><a href="http://www.boost.org/users/faq.html";>FAQ</a></td>
-<td align="center"><a href="../../../more/index.htm">More</a></td> -</tr></table> -<hr> -<div class="spirit-nav">-<a accesskey="p" href="../thread.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../thread.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="thread_management.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
-</div> -<div class="section" lang="en"> -<div class="titlepage"><div><div><h2 class="title" style="clear: both">-<a name="thread.changes"></a><a class="link" href="changes.html" title="Changes since boost 1.35"> Changes since boost 1.35</a>
-</h2></div></div></div> -<p>- The 1.36.0 release of Boost includes a few new features in the thread library:
- </p> -<div class="itemizedlist"><ul type="disc"> -<li>- New generic <a class="link" href="synchronization.html#thread.synchronization.lock_functions.lock_multiple" title="Non-member function lock(Lockable1,Lockable2,...)"><code class="computeroutput"><span class="identifier">lock</span><span class="special">()</span></code></a> - and <a class="link" href="synchronization.html#thread.synchronization.lock_functions.try_lock_multiple" title="Non-member function try_lock(Lockable1,Lockable2,...)"><code class="computeroutput"><span class="identifier">try_lock</span><span class="special">()</span></code></a>
- functions for locking multiple mutexes at once. - </li> -<li>- Rvalue reference support for move semantics where the compilers supports
- it. - </li> -<li>- A few bugs fixed and missing functions added (including the serious win32
- condition variable bug). - </li> -<li>-<code class="computeroutput"><span class="identifier">scoped_try_lock</span></code> types are
- now backwards-compatible with Boost 1.34.0 and previous releases. - </li> -<li>- Support for passing function arguments to the thread function by supplying - additional arguments to the <a class="link" href="thread_management.html#thread.thread_management.thread" title="Class thread"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span></code></a> constructor.
- </li> -<li>- Backwards-compatibility overloads added for <code class="computeroutput"><span class="identifier">timed_lock</span></code> - and <code class="computeroutput"><span class="identifier">timed_wait</span></code> functions - to allow use of <code class="computeroutput"><span class="identifier">xtime</span></code> for
- timeouts. - </li> -</ul></div> -<a name="thread.changes.changes_since_boost_1_34"></a><h4> -<a name="id4041059"></a>- <a class="link" href="changes.html#thread.changes.changes_since_boost_1_34">Changes since boost
- 1.34</a> - </h4> -<p>- Almost every line of code in <span class="bold"><strong>Boost.Thread</strong></span> - has been changed since the 1.34 release of boost. However, most of the interface - changes have been extensions, so the new code is largely backwards-compatible - with the old code. The new features and breaking changes are described below.
- </p> -<a name="thread.changes.new_features"></a><h4> -<a name="id4041094"></a>- <a class="link" href="changes.html#thread.changes.new_features">New Features</a>
- </h4> -<div class="itemizedlist"><ul type="disc"> -<li>- Instances of <a class="link" href="thread_management.html#thread.thread_management.thread" title="Class thread"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span></code></a> and of the various lock types
- are now movable. - </li> -<li>- Threads can be interrupted at <a class="link" href="thread_management.html#interruption_points"><span class="emphasis"><em>interruption
- points</em></span></a>. - </li> -<li>- Condition variables can now be used with any type that implements the <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable" title="Lockable Concept"><code class="computeroutput"><span class="identifier">Lockable</span></code> - concept</a>, through the use of <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">condition_variable_any</span></code> - (<code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">condition</span></code> is a <code class="computeroutput"><span class="keyword">typedef</span></code> - to <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">condition_variable_any</span></code>, provided for backwards - compatibility). <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">condition_variable</span></code> is provided as an optimization, - and will only work with <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">unique_lock</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">mutex</span><span class="special">></span></code> (<code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">mutex</span><span class="special">::</span><span class="identifier">scoped_lock</span></code>).
- </li> -<li>- Thread IDs are separated from <a class="link" href="thread_management.html#thread.thread_management.thread" title="Class thread"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span></code></a>, so a thread can obtain it's - own ID (using <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">this_thread</span><span class="special">::</span><span class="identifier">get_id</span><span class="special">()</span></code>), - and IDs can be used as keys in associative containers, as they have the full
- set of comparison operators. - </li> -<li>- Timeouts are now implemented using the Boost DateTime library, through a - typedef <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">system_time</span></code> for absolute timeouts, and - with support for relative timeouts in many cases. <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">xtime</span></code>
- is supported for backwards compatibility only. - </li> -<li>- Locks are implemented as publicly accessible templates <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">lock_guard</span></code>, - <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">unique_lock</span></code>, <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">shared_lock</span></code>, - and <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">upgrade_lock</span></code>, which are templated on the - type of the mutex. The <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable" title="Lockable Concept"><code class="computeroutput"><span class="identifier">Lockable</span></code> concept</a> has been extended - to include publicly available <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable.lock" title="void lock()"><code class="computeroutput"><span class="identifier">lock</span><span class="special">()</span></code></a> - and <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable.unlock" title="void unlock()"><code class="computeroutput"><span class="identifier">unlock</span><span class="special">()</span></code></a>
- member functions, which are used by the lock types. - </li> -</ul></div> -<a name="thread.changes.breaking_changes"></a><h4> -<a name="id4041580"></a>- <a class="link" href="changes.html#thread.changes.breaking_changes">Breaking Changes</a>
- </h4> -<p>- The list below should cover all changes to the public interface which break
- backwards compatibility. - </p> -<div class="itemizedlist"><ul type="disc"> -<li>-<a class="link" href="synchronization.html#thread.synchronization.mutex_types.try_mutex" title="Typedef try_mutex"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">try_mutex</span></code></a> has been removed, and - the functionality subsumed into <a class="link" href="synchronization.html#thread.synchronization.mutex_types.mutex" title="Class mutex"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">mutex</span></code></a>. <a class="link" href="synchronization.html#thread.synchronization.mutex_types.try_mutex" title="Typedef try_mutex"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">try_mutex</span></code></a> is left as a <code class="computeroutput"><span class="keyword">typedef</span></code>, but is no longer a separate class.
- </li> -<li>-<a class="link" href="synchronization.html#thread.synchronization.mutex_types.recursive_try_mutex" title="Typedef recursive_try_mutex"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">recursive_try_mutex</span></code></a> has been removed, - and the functionality subsumed into <a class="link" href="synchronization.html#thread.synchronization.mutex_types.recursive_mutex" title="Class recursive_mutex"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">recursive_mutex</span></code></a>. <a class="link" href="synchronization.html#thread.synchronization.mutex_types.recursive_try_mutex" title="Typedef recursive_try_mutex"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">recursive_try_mutex</span></code></a> is left as a - <code class="computeroutput"><span class="keyword">typedef</span></code>, but is no longer a
- separate class. - </li> -<li>-<code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">detail</span><span class="special">::</span><span class="identifier">thread</span><span class="special">::</span><span class="identifier">lock_ops</span></code> has been removed. Code that relies - on the <code class="computeroutput"><span class="identifier">lock_ops</span></code> implementation - detail will no longer work, as this has been removed, as it is no longer - necessary now that mutex types now have public <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable.lock" title="void lock()"><code class="computeroutput"><span class="identifier">lock</span><span class="special">()</span></code></a> - and <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable.unlock" title="void unlock()"><code class="computeroutput"><span class="identifier">unlock</span><span class="special">()</span></code></a>
- member functions. - </li> -<li>-<code class="computeroutput"><span class="identifier">scoped_lock</span></code> constructors - with a second parameter of type <code class="computeroutput"><span class="keyword">bool</span></code>
- are no longer provided. With previous boost releases,-<pre class="programlisting"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">mutex</span><span class="special">::</span><span class="identifier">scoped_lock</span> <span class="identifier">some_lock</span><span class="special">(</span><span class="identifier">some_mutex</span><span class="special">,</span><span class="keyword">false</span><span class="special">);</span></pre> - could be used to create a lock object that was associated with a mutex, but - did not lock it on construction. This facility has now been replaced with - the constructor that takes a <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">defer_lock_type</span></code>
- as the second parameter:-<pre class="programlisting"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">mutex</span><span class="special">::</span><span class="identifier">scoped_lock</span> <span class="identifier">some_lock</span><span class="special">(</span><span class="identifier">some_mutex</span><span class="special">,</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">defer_lock</span><span class="special">);</span></pre>
-</li> -<li>- The <code class="computeroutput"><span class="identifier">locked</span><span class="special">()</span></code> - member function of the <code class="computeroutput"><span class="identifier">scoped_lock</span></code> - types has been renamed to <a class="link" href="synchronization.html#thread.synchronization.locks.unique_lock.owns_lock" title="bool owns_lock() const"><code class="computeroutput"><span class="identifier">owns_lock</span><span class="special">()</span></code></a>.
- </li> -<li>- You can no longer obtain a <a class="link" href="thread_management.html#thread.thread_management.thread" title="Class thread"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span></code></a> instance representing the - current thread: a default-constructed <a class="link" href="thread_management.html#thread.thread_management.thread" title="Class thread"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span></code></a> object is not associated - with any thread. The only use for such a thread object was to support the - comparison operators: this functionality has been moved to <a class="link" href="thread_management.html#thread.thread_management.thread.id" title="Class boost::thread::id"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span><span class="special">::</span><span class="identifier">id</span></code></a>.
- </li> -<li>- The broken <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">read_write_mutex</span></code> has been replaced with - <a class="link" href="synchronization.html#thread.synchronization.mutex_types.shared_mutex" title="Class shared_mutex"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">shared_mutex</span></code></a>.
- </li> -<li>-<a class="link" href="synchronization.html#thread.synchronization.mutex_types.mutex" title="Class mutex"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">mutex</span></code></a> - is now never recursive. For Boost releases prior to 1.35 <a class="link" href="synchronization.html#thread.synchronization.mutex_types.mutex" title="Class mutex"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">mutex</span></code></a> was recursive on Windows and
- not on POSIX platforms. - </li> -<li>- When using a <a class="link" href="synchronization.html#thread.synchronization.mutex_types.recursive_mutex" title="Class recursive_mutex"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">recursive_mutex</span></code></a> with a call to - <a class="link" href="synchronization.html#thread.synchronization.condvar_ref.condition_variable_any.wait" title="template<typename lock_type> void wait(lock_type& lock)"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">condition_variable_any</span><span class="special">::</span><span class="identifier">wait</span><span class="special">()</span></code></a>, - the mutex is only unlocked one level, and not completely. This prior behaviour
- was not guaranteed and did not feature in the tests. - </li> -</ul></div> -</div>-<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"; width="100%"><tr>
-<td align="left"></td>-<td align="right"><div class="copyright-footer">Copyright 2007 -8 Anthony Williams<p> - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt"; target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
- </p> -</div></td> -</tr></table> -<hr> -<div class="spirit-nav">-<a accesskey="p" href="../thread.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../thread.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="thread_management.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
-</div> -</body> -</html> +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> ++<title>Changes since boost 1.35</title><link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">+<link rel="start" href="../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
+<link rel="up" href="../thread.html" title="Chapter 19. Thread">+<link rel="prev" href="../thread.html" title="Chapter 19. Thread"> +<link rel="next" href="thread_management.html" title="Thread Management"></head> +<body alink="#0000ff" bgcolor="white" link="#0000ff" text="black" vlink="#840084">
+<table cellpadding="2" width="100%"><tbody><tr>+<td valign="top"><img alt="Boost C++ Libraries" src="../../../boost.png" height="86" width="277"></td>
+<td align="center"><a href="../../../index.html">Home</a></td> +<td align="center"><a href="../../../libs/libraries.htm">Libraries</a></td>+<td align="center"><a href="http://www.boost.org/users/people.html";>People</a></td> +<td align="center"><a href="http://www.boost.org/users/faq.html";>FAQ</a></td>
+<td align="center"><a href="../../../more/index.htm">More</a></td> +</tr></tbody></table> +<hr> +<div class="spirit-nav">+<a accesskey="p" href="../thread.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../thread.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="thread_management.html"><img src="../../../doc/html/images/next.png" alt="Next"></a> +</div><h2 class="title" style="clear: both;"><a class="link" href="../thread_/changes.html" title="Changes since boost 1.35"> Changes since boost 1.35</a>
+</h2> +<p>1.36.0 版新特性: + </p> +<div class="itemizedlist"><ul type="disc"><li>+ 新的通用锁定函数 <a class="link" href="../thread_/synchronization.html#thread.synchronization.lock_functions.lock_multiple" title="Non-member function lock(Lockable1,Lockable2,...)"><code class="computeroutput"><span class="identifier">lock</span><span class="special">()</span></code></a> , <a class="link" href="../thread_/synchronization.html#thread.synchronization.lock_functions.try_lock_multiple" title="Non-member function try_lock(Lockable1,Lockable2,...)"><code class="computeroutput"><span class="identifier">try_lock</span><span class="special">()</span></code></a>,可以一次锁定多个互斥量。 + </li><li>编译器支持的条件下,支持转移语义中的右值引用。 + </li><li>修复了一些问题,补上了一些缺失的函数(包括 win32 平台上状态变量的严重bug)。
+ </li><li>+<code class="computeroutput"><span class="identifier">scoped_try_lock</span></code> 类型兼容于 Boost 1.34.0 和更早的版本。
+ </li><li>+ 支持通过<a class="link" href="../thread_/thread_management.html#thread.thread_management.thread" title="Class thread"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span></code></a>构造函数的额外参数传递函数参数给线程函数。
+ </li><li>+ 重载<code class="computeroutput"><span class="identifier">timed_lock</span></code> 和 <code class="computeroutput"><span class="identifier">timed_wait</span></code> functions函数支持使用 <code class="computeroutput"><span class="identifier">xtime</span></code> 做超时类型。
+ </li></ul></div> +<a name="thread.changes.changes_since_boost_1_34"></a><h4> +<a name="id3714929"></a>+ <a class="link" href="../thread_/changes.html#thread.changes.changes_since_boost_1_34">Changes since boost
+ 1.34</a> + </h4> +<p>+ <span class="bold"><strong>Boost.Thread库</strong></span>差不多<span class="bold"><strong></strong></span>的所有代码和 1.34相比都被改写了。然而,大多数接口变化被扩展,使这些新的代码也能兼容就的代码。 新特性和明显的变化列举如下:
+ </p> +<a name="thread.changes.new_features"></a><h4> +<a name="id3714965"></a>+ <a class="link" href="../thread_/changes.html#thread.changes.new_features">New Features</a>
+ </h4>+<div class="itemizedlist"><ul type="disc"><li><a class="link" href="../thread_/thread_management.html#thread.thread_management.thread" title="Class thread"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span></code></a>和锁类型支持转移语义。 + </li><li>线程可在中断点被中断。</li><li> + 条件变量(<code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">condition_variable_any</span></code>)现在可以和任意实现了可锁定概念的类型一起工作。 <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">condition是一个优化的,提供兼容的类型定义,并且他只能和</span></code> <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">unique_lock</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">mutex</span><span class="special">></span></code> (<code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">mutex</span><span class="special">::</span><span class="identifier">scoped_lock</span></code>)一起工作。
+ </li><li>+ 线程标识从 <a class="link" href="../thread_/thread_management.html#thread.thread_management.thread" title="Class thread"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread类中分离出来</span></code></a>, 这样一个线程可以获得自己的对应的标识, 并且线程标识可以被用作关联容器的键,因为它们有完全的比较操作符。
+ </li><li>+ 通过 Boost DateTime library实现了超时,采用<code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">system_time</span></code> 作为绝对时间,在很多场合支持相对的时间段超时, <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">xtime</span></code> + 只是为了兼容性和被支持。
+ </li><li>+ 锁定通过一些公开的模板实现,如<code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">lock_guard</span></code>, + <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">unique_lock</span></code>, <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">shared_lock</span></code>, 和<code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">upgrade_lock</span></code>, 具体实现取决于作为模板参数的互斥量。可锁定概念被扩展,增加<a class="link" href="../thread_/synchronization.html#thread.synchronization.mutex_concepts.lockable.lock" title="void lock()"><code class="computeroutput"><span class="identifier">供锁定操作需要使用的lock</span><span class="special">()</span></code></a> 和 <a class="link" href="../thread_/synchronization.html#thread.synchronization.mutex_concepts.lockable.unlock" title="void unlock()"><code class="computeroutput"><span class="identifier">unlock</span><span class="special">()</span></code></a> 函数。
+ </li></ul></div> +<a name="thread.changes.breaking_changes"></a><h4> +<a name="id3715450"></a>+ <a class="link" href="../thread_/changes.html#thread.changes.breaking_changes">Breaking Changes</a>
+ </h4> +<p>+ 下面列出没有保持兼容的接口改变:
+ </p> +<div class="itemizedlist"><ul type="disc"><li>+<a class="link" href="../thread_/synchronization.html#thread.synchronization.mutex_types.try_mutex" title="Typedef try_mutex"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">try_mutex</span></code></a> 被移除了, 它的功能被包含在<a class="link" href="../thread_/synchronization.html#thread.synchronization.mutex_types.mutex" title="Class mutex"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">mutex</span></code></a>。 <a class="link" href="../thread_/synchronization.html#thread.synchronization.mutex_types.try_mutex" title="Typedef try_mutex"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">try_mutex</span></code></a> 只是作为一个类型定义存在,而不是单独的类。
+ </li><li>+<a class="link" href="../thread_/synchronization.html#thread.synchronization.mutex_types.recursive_try_mutex" title="Typedef recursive_try_mutex"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">recursive_try_mutex</span></code></a> 被移除了, 其功能被包含在 <a class="link" href="../thread_/synchronization.html#thread.synchronization.mutex_types.recursive_mutex" title="Class recursive_mutex"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">recursive_mutex</span></code></a>. <a class="link" href="../thread_/synchronization.html#thread.synchronization.mutex_types.recursive_try_mutex" title="Typedef recursive_try_mutex"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">recursive_try_mutex</span></code></a> 只是作为一个类型定义存在,而不是单独的类。
+ </li><li>+<code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">detail</span><span class="special">::</span><span class="identifier">thread</span><span class="special">::</span><span class="identifier">lock_ops</span></code> 被移除了,依赖于<code class="computeroutput"><span class="identifier">lock_ops</span></code> 实现的代码将不能工作。<code class="computeroutput"><span class="identifier">lock_ops已经不再需要,因为互斥量现在已经有空开的</span></code> <a class="link" href="../thread_/synchronization.html#thread.synchronization.mutex_concepts.lockable.lock" title="void lock()"><code class="computeroutput"><span class="identifier">lock</span><span class="special">()</span></code></a> 和 <a class="link" href="../thread_/synchronization.html#thread.synchronization.mutex_concepts.lockable.unlock" title="void unlock()"><code class="computeroutput"><span class="identifier">unlock</span><span class="special">()<span style="font-family: sans;"> 函数。</span></span></code></a>
+ </li><li>+<code class="computeroutput"><span class="identifier">scoped_lock</span></code> 中支持第二个<code class="computeroutput"><span class="keyword">bool</span></code> +参数的构造函数被移除了。在以前的boost 版本,如下的定义 +<pre class="programlisting"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">mutex</span><span class="special">::</span><span class="identifier">scoped_lock</span> <span class="identifier">some_lock</span><span class="special">(</span><span class="identifier">some_mutex</span><span class="special">,</span><span class="keyword">false</span><span class="special">);</span></pre> + could可以用来创建一个和互斥量关联的锁对象, 但是并不马上在构造是锁定它。 这个功能现在被携带<code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">defer_lock_type</span></code>
+参数的构造函数代替了:+<pre class="programlisting"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">mutex</span><span class="special">::</span><span class="identifier">scoped_lock</span> <span class="identifier">some_lock</span><span class="special">(</span><span class="identifier">some_mutex</span><span class="special">,</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">defer_lock</span><span class="special">);</span></pre>
+</li><li>+ <code class="computeroutput"><span class="identifier">scoped_lock</span></code> 类型的成员函数<code class="computeroutput"><span class="identifier">locked</span><span class="special">()</span></code> 改名为<a class="link" href="../thread_/synchronization.html#thread.synchronization.locks.unique_lock.owns_lock" title="bool owns_lock() const"><code class="computeroutput"><span class="identifier">owns_lock</span><span class="special">()</span></code></a>。 + </li><li>不能在当前线程内获得代表自己的<a class="link" href="../thread_/thread_management.html#thread.thread_management.thread" title="Class thread"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span></code></a> 对象,现在一个默认构造出来的 <a class="link" href="../thread_/thread_management.html#thread.thread_management.thread" title="Class thread"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span></code></a> 实例不会关联到任何线程,这样的实例唯一的用处是在线程做比较时。现在这些功能(标识线程)都被移到 <a class="link" href="../thread_/thread_management.html#thread.thread_management.thread.id" title="Class boost::thread::id"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span><span class="special">::</span><span class="identifier">id</span></code></a>类型里了。
+ </li><li>+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">read_write_mutex</span></code> 被 + <a class="link" href="../thread_/synchronization.html#thread.synchronization.mutex_types.shared_mutex" title="Class shared_mutex"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">shared_mutex取代了</span></code></a>。
+ </li><li>+<a class="link" href="../thread_/synchronization.html#thread.synchronization.mutex_types.mutex" title="Class mutex"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">mutex</span></code></a> + 现在不是支持递归的,在1.35版以前, <a class="link" href="../thread_/synchronization.html#thread.synchronization.mutex_types.mutex" title="Class mutex"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">mutex</span></code></a> 在 Windows平台上是支持递归的,而在POSIX 平台上却不是。
+ </li><li>+ 当a <a class="link" href="../thread_/synchronization.html#thread.synchronization.mutex_types.recursive_mutex" title="Class recursive_mutex"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">recursive_mutex</span></code></a> 配合<a class="link" href="../thread_/synchronization.html#thread.synchronization.condvar_ref.condition_variable_any.wait" title="template<typename lock_type> void wait(lock_type& lock)"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">condition_variable_any</span><span class="special">::</span><span class="identifier">wait</span><span class="special">()</span></code></a>使用时,该函数只是释放一次锁定,而不是所有的锁定。这个在以前是不被保证的,也没有体现在测试代码中。 + </li></ul></div><table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"; width="100%"><tbody><tr><td align="left"></td><td align="right"><div class="copyright-footer">Copyright 2007 -8 Anthony Williams<p> + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt"; target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
+ </p> +</div></td> +</tr></tbody></table> +<hr> +<div class="spirit-nav">+<a accesskey="p" href="../thread.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../thread.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="thread_management.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+</div> +</body></html> \ No newline at end of file Modified: trunk/doc/html/thread/synchronization.html ============================================================================== --- trunk/doc/html/thread/synchronization.html (original) +++ trunk/doc/html/thread/synchronization.html Sun Apr 19 20:16:56 2009 @@ -1,3417 +1,1773 @@ -<html> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> -<title>Synchronization</title> -<link rel="stylesheet" href="../boostbook.css" type="text/css"> -<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">-<link rel="start" href="../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
-<link rel="up" href="../thread.html" title="Chapter 19. Thread"> -<link rel="prev" href="thread_management.html" title="Thread Management">-<link rel="next" href="thread_local_storage.html" title="Thread Local Storage">
-</head>-<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table cellpadding="2" width="100%"><tr>-<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../boost.png"></td>
-<td align="center"><a href="../../../index.html">Home</a></td> -<td align="center"><a href="../../../libs/libraries.htm">Libraries</a></td>-<td align="center"><a href="http://www.boost.org/users/people.html";>People</a></td> -<td align="center"><a href="http://www.boost.org/users/faq.html";>FAQ</a></td>
-<td align="center"><a href="../../../more/index.htm">More</a></td> -</tr></table> -<hr> -<div class="spirit-nav">-<a accesskey="p" href="thread_management.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../thread.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="thread_local_storage.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
-</div> -<div class="section" lang="en"> -<div class="titlepage"><div><div><h2 class="title" style="clear: both">-<a name="thread.synchronization"></a><a class="link" href="synchronization.html" title="Synchronization"> Synchronization</a>
-</h2></div></div></div> -<div class="toc"><dl>-<dt><span class="section"><a href="synchronization.html#thread.synchronization.mutex_concepts"> Mutex Concepts</a></span></dt> -<dt><span class="section"><a href="synchronization.html#thread.synchronization.locks"> Lock Types</a></span></dt> -<dt><span class="section"><a href="synchronization.html#thread.synchronization.lock_functions"> Lock functions</a></span></dt> -<dt><span class="section"><a href="synchronization.html#thread.synchronization.mutex_types"> Mutex Types</a></span></dt> -<dt><span class="section"><a href="synchronization.html#thread.synchronization.condvar_ref"> Condition Variables</a></span></dt> -<dt><span class="section"><a href="synchronization.html#thread.synchronization.once"> One-time Initialization</a></span></dt> -<dt><span class="section"><a href="synchronization.html#thread.synchronization.barriers"> Barriers</a></span></dt>
-</dl></div> -<div class="section" lang="en"> -<div class="titlepage"><div><div><h3 class="title">-<a name="thread.synchronization.mutex_concepts"></a><a class="link" href="synchronization.html#thread.synchronization.mutex_concepts" title="Mutex Concepts"> Mutex Concepts</a>
-</h3></div></div></div> -<div class="toc"><dl>-<dt><span class="section"><a href="synchronization.html#thread.synchronization.mutex_concepts.lockable"> <code class="computeroutput"><span class="identifier">Lockable</span></code> Concept</a></span></dt> -<dt><span class="section"><a href="synchronization.html#thread.synchronization.mutex_concepts.timed_lockable"> - <code class="computeroutput"><span class="identifier">TimedLockable</span></code> Concept</a></span></dt> -<dt><span class="section"><a href="synchronization.html#thread.synchronization.mutex_concepts.shared_lockable"> - <code class="computeroutput"><span class="identifier">SharedLockable</span></code> Concept</a></span></dt> -<dt><span class="section"><a href="synchronization.html#thread.synchronization.mutex_concepts.upgrade_lockable"> - <code class="computeroutput"><span class="identifier">UpgradeLockable</span></code> Concept</a></span></dt>
-</dl></div> -<p>- A mutex object facilitates protection against data races and allows thread-safe - synchronization of data between threads. A thread obtains ownership of a - mutex object by calling one of the lock functions and relinquishes ownership - by calling the corresponding unlock function. Mutexes may be either recursive - or non-recursive, and may grant simultaneous ownership to one or many threads. - <span class="bold"><strong>Boost.Thread</strong></span> supplies recursive and non-recursive - mutexes with exclusive ownership semantics, along with a shared ownership
- (multiple-reader / single-writer) mutex. - </p> -<p>- <span class="bold"><strong>Boost.Thread</strong></span> supports four basic concepts - for lockable objects: <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable" title="Lockable Concept"><code class="computeroutput"><span class="identifier">Lockable</span></code></a>, <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.timed_lockable" title="TimedLockable Concept"><code class="computeroutput"><span class="identifier">TimedLockable</span></code></a>, <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.shared_lockable" title="SharedLockable Concept"><code class="computeroutput"><span class="identifier">SharedLockable</span></code></a> and <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.upgrade_lockable" title="UpgradeLockable Concept"><code class="computeroutput"><span class="identifier">UpgradeLockable</span></code></a>. Each mutex type - implements one or more of these concepts, as do the various lock types.
- </p> -<div class="section" lang="en"> -<div class="titlepage"><div><div><h4 class="title">-<a name="thread.synchronization.mutex_concepts.lockable"></a><a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable" title="Lockable Concept"> <code class="computeroutput"><span class="identifier">Lockable</span></code> Concept</a>
-</h4></div></div></div> -<div class="toc"><dl>-<dt><span class="section"><a href="synchronization.html#thread.synchronization.mutex_concepts.lockable.lock"> - <code class="computeroutput"><span class="keyword">void</span> <span class="identifier">lock</span><span class="special">()</span></code></a></span></dt> -<dt><span class="section"><a href="synchronization.html#thread.synchronization.mutex_concepts.lockable.try_lock"> - <code class="computeroutput"><span class="keyword">bool</span> <span class="identifier">try_lock</span><span class="special">()</span></code></a></span></dt> -<dt><span class="section"><a href="synchronization.html#thread.synchronization.mutex_concepts.lockable.unlock"> - <code class="computeroutput"><span class="keyword">void</span> <span class="identifier">unlock</span><span class="special">()</span></code></a></span></dt>
-</dl></div> -<p>- The <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable" title="Lockable Concept"><code class="computeroutput"><span class="identifier">Lockable</span></code> concept</a> models exclusive - ownership. A type that implements the <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable" title="Lockable Concept"><code class="computeroutput"><span class="identifier">Lockable</span></code> concept</a> shall provide
- the following member functions: - </p> -<div class="itemizedlist"><ul type="disc">-<li><a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable.lock" title="void lock()"><code class="computeroutput"><span class="keyword">void</span> <span class="identifier">lock</span><span class="special">();</span></code></a></li> -<li><a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable.try_lock" title="bool try_lock()"><code class="computeroutput"><span class="keyword">bool</span> <span class="identifier">try_lock</span><span class="special">();</span></code></a></li> -<li><a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable.unlock" title="void unlock()"><code class="computeroutput"><span class="keyword">void</span> <span class="identifier">unlock</span><span class="special">();</span></code></a></li>
-</ul></div> -<p>- Lock ownership acquired through a call to <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable.lock" title="void lock()"><code class="computeroutput"><span class="identifier">lock</span><span class="special">()</span></code></a> - or <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable.try_lock" title="bool try_lock()"><code class="computeroutput"><span class="identifier">try_lock</span><span class="special">()</span></code></a> - must be released through a call to <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable.unlock" title="void unlock()"><code class="computeroutput"><span class="identifier">unlock</span><span class="special">()</span></code></a>.
- </p> -<div class="section" lang="en"> -<div class="titlepage"><div><div><h5 class="title">-<a name="thread.synchronization.mutex_concepts.lockable.lock"></a><a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable.lock" title="void lock()"> - <code class="computeroutput"><span class="keyword">void</span> <span class="identifier">lock</span><span class="special">()</span></code></a>
-</h5></div></div></div> -<div class="variablelist"> -<p class="title"><b></b></p> -<dl> -<dt><span class="term">Effects:</span></dt> -<dd><p>- The current thread blocks until ownership can be obtained for the
- current thread. - </p></dd> -<dt><span class="term">Postcondition:</span></dt> -<dd><p>- The current thread owns <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
- </p></dd> -<dt><span class="term">Throws:</span></dt> -<dd><p>- <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread_resource_error</span></code> if an error
- occurs. - </p></dd> -</dl> -</div> -</div> -<div class="section" lang="en"> -<div class="titlepage"><div><div><h5 class="title">-<a name="thread.synchronization.mutex_concepts.lockable.try_lock"></a><a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable.try_lock" title="bool try_lock()"> - <code class="computeroutput"><span class="keyword">bool</span> <span class="identifier">try_lock</span><span class="special">()</span></code></a>
-</h5></div></div></div> -<div class="variablelist"> -<p class="title"><b></b></p> -<dl> -<dt><span class="term">Effects:</span></dt> -<dd><p>- Attempt to obtain ownership for the current thread without blocking.
- </p></dd> -<dt><span class="term">Returns:</span></dt> -<dd><p>- <code class="computeroutput"><span class="keyword">true</span></code> if ownership was - obtained for the current thread, <code class="computeroutput"><span class="keyword">false</span></code>
- otherwise. - </p></dd> -<dt><span class="term">Postcondition:</span></dt> -<dd><p>- If the call returns <code class="computeroutput"><span class="keyword">true</span></code>, - the current thread owns the <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
- </p></dd> -<dt><span class="term">Throws:</span></dt> -<dd><p>- <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread_resource_error</span></code> if an error
- occurs. - </p></dd> -</dl> -</div> -</div> -<div class="section" lang="en"> -<div class="titlepage"><div><div><h5 class="title">-<a name="thread.synchronization.mutex_concepts.lockable.unlock"></a><a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable.unlock" title="void unlock()"> - <code class="computeroutput"><span class="keyword">void</span> <span class="identifier">unlock</span><span class="special">()</span></code></a>
-</h5></div></div></div> -<div class="variablelist"> -<p class="title"><b></b></p> -<dl> -<dt><span class="term">Precondition:</span></dt> -<dd><p>- The current thread owns <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
- </p></dd> -<dt><span class="term">Effects:</span></dt> -<dd><p> - Releases ownership by the current thread. - </p></dd> -<dt><span class="term">Postcondition:</span></dt> -<dd><p>- The current thread no longer owns <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
- </p></dd> -<dt><span class="term">Throws:</span></dt> -<dd><p> - Nothing - </p></dd> -</dl> -</div> -</div> -</div> -<div class="section" lang="en"> -<div class="titlepage"><div><div><h4 class="title">-<a name="thread.synchronization.mutex_concepts.timed_lockable"></a><a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.timed_lockable" title="TimedLockable Concept"> - <code class="computeroutput"><span class="identifier">TimedLockable</span></code> Concept</a>
-</h4></div></div></div> -<div class="toc"><dl>-<dt><span class="section"><a href="synchronization.html#thread.synchronization.mutex_concepts.timed_lockable.timed_lock"> - <code class="computeroutput"><span class="keyword">bool</span> <span class="identifier">timed_lock</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">system_time</span> - <span class="keyword">const</span><span class="special">&</span> - <span class="identifier">abs_time</span><span class="special">)</span></code></a></span></dt> -<dt><span class="section"><a href="synchronization.html#thread.synchronization.mutex_concepts.timed_lockable.timed_lock_duration"> - <code class="computeroutput"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">DurationType</span><span class="special">></span> <span class="keyword">bool</span> <span class="identifier">timed_lock</span><span class="special">(</span><span class="identifier">DurationType</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">rel_time</span><span class="special">)</span></code></a></span></dt>
-</dl></div> -<p>- The <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.timed_lockable" title="TimedLockable Concept"><code class="computeroutput"><span class="identifier">TimedLockable</span></code> concept</a> refines - the <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable" title="Lockable Concept"><code class="computeroutput"><span class="identifier">Lockable</span></code> concept</a> to add support
- for timeouts when trying to acquire the lock. - </p> -<p>- A type that implements the <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.timed_lockable" title="TimedLockable Concept"><code class="computeroutput"><span class="identifier">TimedLockable</span></code> concept</a> shall meet - the requirements of the <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable" title="Lockable Concept"><code class="computeroutput"><span class="identifier">Lockable</span></code> concept</a>. In addition,
- the following member functions must be provided: - </p> -<div class="itemizedlist"><ul type="disc">-<li><a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.timed_lockable.timed_lock" title="bool timed_lock(boost::system_time const& abs_time)"><code class="computeroutput"><span class="keyword">bool</span> <span class="identifier">timed_lock</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">system_time</span> - <span class="keyword">const</span><span class="special">&</span> - <span class="identifier">abs_time</span><span class="special">);</span></code></a></li> -<li><a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.timed_lockable.timed_lock_duration" title="template<typename DurationType> bool timed_lock(DurationType const& rel_time)"><code class="computeroutput"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">DurationType</span><span class="special">></span> <span class="keyword">bool</span> <span class="identifier">timed_lock</span><span class="special">(</span><span class="identifier">DurationType</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">rel_time</span><span class="special">);</span></code></a></li>
-</ul></div> -<p>- Lock ownership acquired through a call to <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.timed_lockable.timed_lock" title="bool timed_lock(boost::system_time const& abs_time)"><code class="computeroutput"><span class="identifier">timed_lock</span><span class="special">()</span></code></a> - must be released through a call to <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable.unlock" title="void unlock()"><code class="computeroutput"><span class="identifier">unlock</span><span class="special">()</span></code></a>.
- </p> -<div class="section" lang="en"> -<div class="titlepage"><div><div><h5 class="title">-<a name="thread.synchronization.mutex_concepts.timed_lockable.timed_lock"></a><a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.timed_lockable.timed_lock" title="bool timed_lock(boost::system_time const& abs_time)"> - <code class="computeroutput"><span class="keyword">bool</span> <span class="identifier">timed_lock</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">system_time</span> - <span class="keyword">const</span><span class="special">&</span> - <span class="identifier">abs_time</span><span class="special">)</span></code></a>
-</h5></div></div></div> -<div class="variablelist"> -<p class="title"><b></b></p> -<dl> -<dt><span class="term">Effects:</span></dt> -<dd><p>- Attempt to obtain ownership for the current thread. Blocks until - ownership can be obtained, or the specified time is reached. If the - specified time has already passed, behaves as <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable.try_lock" title="bool try_lock()"><code class="computeroutput"><span class="identifier">try_lock</span><span class="special">()</span></code></a>.
- </p></dd> -<dt><span class="term">Returns:</span></dt> -<dd><p>- <code class="computeroutput"><span class="keyword">true</span></code> if ownership was - obtained for the current thread, <code class="computeroutput"><span class="keyword">false</span></code>
- otherwise. - </p></dd> -<dt><span class="term">Postcondition:</span></dt> -<dd><p>- If the call returns <code class="computeroutput"><span class="keyword">true</span></code>, - the current thread owns <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
- </p></dd> -<dt><span class="term">Throws:</span></dt> -<dd><p>- <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread_resource_error</span></code> if an error
- occurs. - </p></dd> -</dl> -</div> -</div> -<div class="section" lang="en"> -<div class="titlepage"><div><div><h5 class="title">-<a name="thread.synchronization.mutex_concepts.timed_lockable.timed_lock_duration"></a><a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.timed_lockable.timed_lock_duration" title="template<typename DurationType> bool timed_lock(DurationType const& rel_time)"> - <code class="computeroutput"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">DurationType</span><span class="special">></span> <span class="keyword">bool</span> <span class="identifier">timed_lock</span><span class="special">(</span><span class="identifier">DurationType</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">rel_time</span><span class="special">)</span></code></a>
-</h5></div></div></div> -<div class="variablelist"> -<p class="title"><b></b></p> -<dl> -<dt><span class="term">Effects:</span></dt> -<dd><p>- As-if <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.timed_lockable.timed_lock" title="bool timed_lock(boost::system_time const& abs_time)"><code class="computeroutput"><span class="identifier">timed_lock</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">get_system_time</span><span class="special">()+</span><span class="identifier">rel_time</span><span class="special">)</span></code></a>.
- </p></dd> -</dl> -</div> -</div> -</div> -<div class="section" lang="en"> -<div class="titlepage"><div><div><h4 class="title">-<a name="thread.synchronization.mutex_concepts.shared_lockable"></a><a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.shared_lockable" title="SharedLockable Concept"> - <code class="computeroutput"><span class="identifier">SharedLockable</span></code> Concept</a>
-</h4></div></div></div> -<div class="toc"><dl>-<dt><span class="section"><a href="synchronization.html#thread.synchronization.mutex_concepts.shared_lockable.lock_shared"> - <code class="computeroutput"><span class="keyword">void</span> <span class="identifier">lock_shared</span><span class="special">()</span></code></a></span></dt> -<dt><span class="section"><a href="synchronization.html#thread.synchronization.mutex_concepts.shared_lockable.try_lock_shared"> - <code class="computeroutput"><span class="keyword">bool</span> <span class="identifier">try_lock_shared</span><span class="special">()</span></code></a></span></dt> -<dt><span class="section"><a href="synchronization.html#thread.synchronization.mutex_concepts.shared_lockable.timed_lock_shared"> - <code class="computeroutput"><span class="keyword">bool</span> <span class="identifier">timed_lock_shared</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">system_time</span> - <span class="keyword">const</span><span class="special">&</span> - <span class="identifier">abs_time</span><span class="special">)</span></code></a></span></dt> -<dt><span class="section"><a href="synchronization.html#thread.synchronization.mutex_concepts.shared_lockable.unlock_shared"> - <code class="computeroutput"><span class="keyword">void</span> <span class="identifier">unlock_shared</span><span class="special">()</span></code></a></span></dt>
-</dl></div> -<p>- The <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.shared_lockable" title="SharedLockable Concept"><code class="computeroutput"><span class="identifier">SharedLockable</span></code> concept</a> is a refinement - of the <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.timed_lockable" title="TimedLockable Concept"><code class="computeroutput"><span class="identifier">TimedLockable</span></code> concept</a> that allows - for <span class="emphasis"><em>shared ownership</em></span> as well as <span class="emphasis"><em>exclusive - ownership</em></span>. This is the standard multiple-reader / single-write - model: at most one thread can have exclusive ownership, and if any thread - does have exclusive ownership, no other threads can have shared or exclusive
- ownership. Alternatively, many threads may have shared ownership. - </p> -<p>- For a type to implement the <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.shared_lockable" title="SharedLockable Concept"><code class="computeroutput"><span class="identifier">SharedLockable</span></code> concept</a>, as well - as meeting the requirements of the <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.timed_lockable" title="TimedLockable Concept"><code class="computeroutput"><span class="identifier">TimedLockable</span></code> concept</a>, it must
- also provide the following member functions: - </p> -<div class="itemizedlist"><ul type="disc">-<li><a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.shared_lockable.lock_shared" title="void lock_shared()"><code class="computeroutput"><span class="keyword">void</span> <span class="identifier">lock_shared</span><span class="special">();</span></code></a></li> -<li><a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.shared_lockable.try_lock_shared" title="bool try_lock_shared()"><code class="computeroutput"><span class="keyword">bool</span> <span class="identifier">try_lock_shared</span><span class="special">();</span></code></a></li> -<li><a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.shared_lockable.unlock_shared" title="void unlock_shared()"><code class="computeroutput"><span class="keyword">bool</span> <span class="identifier">unlock_shared</span><span class="special">();</span></code></a></li> -<li><a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.shared_lockable.timed_lock_shared" title="bool timed_lock_shared(boost::system_time const& abs_time)"><code class="computeroutput"><span class="keyword">bool</span> <span class="identifier">timed_lock_shared</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">system_time</span> - <span class="keyword">const</span><span class="special">&</span> - <span class="identifier">abs_time</span><span class="special">);</span></code></a></li>
-</ul></div> -<p>- Lock ownership acquired through a call to <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.shared_lockable.lock_shared" title="void lock_shared()"><code class="computeroutput"><span class="identifier">lock_shared</span><span class="special">()</span></code></a>, - <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.shared_lockable.try_lock_shared" title="bool try_lock_shared()"><code class="computeroutput"><span class="identifier">try_lock_shared</span><span class="special">()</span></code></a> - or <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.shared_lockable.timed_lock_shared" title="bool timed_lock_shared(boost::system_time const& abs_time)"><code class="computeroutput"><span class="identifier">timed_lock_shared</span><span class="special">()</span></code></a> - must be released through a call to <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.shared_lockable.unlock_shared" title="void unlock_shared()"><code class="computeroutput"><span class="identifier">unlock_shared</span><span class="special">()</span></code></a>.
- </p> -<div class="section" lang="en"> -<div class="titlepage"><div><div><h5 class="title">-<a name="thread.synchronization.mutex_concepts.shared_lockable.lock_shared"></a><a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.shared_lockable.lock_shared" title="void lock_shared()"> - <code class="computeroutput"><span class="keyword">void</span> <span class="identifier">lock_shared</span><span class="special">()</span></code></a>
-</h5></div></div></div> -<div class="variablelist"> -<p class="title"><b></b></p> -<dl> -<dt><span class="term">Effects:</span></dt> -<dd><p>- The current thread blocks until shared ownership can be obtained
- for the current thread. - </p></dd> -<dt><span class="term">Postcondition:</span></dt> -<dd><p>- The current thread has shared ownership of <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
- </p></dd> -<dt><span class="term">Throws:</span></dt> -<dd><p>- <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread_resource_error</span></code> if an error
- occurs. - </p></dd> -</dl> -</div> -</div> -<div class="section" lang="en"> -<div class="titlepage"><div><div><h5 class="title">-<a name="thread.synchronization.mutex_concepts.shared_lockable.try_lock_shared"></a><a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.shared_lockable.try_lock_shared" title="bool try_lock_shared()"> - <code class="computeroutput"><span class="keyword">bool</span> <span class="identifier">try_lock_shared</span><span class="special">()</span></code></a>
-</h5></div></div></div> -<div class="variablelist"> -<p class="title"><b></b></p> -<dl> -<dt><span class="term">Effects:</span></dt> -<dd><p>- Attempt to obtain shared ownership for the current thread without
- blocking. - </p></dd> -<dt><span class="term">Returns:</span></dt> -<dd><p>- <code class="computeroutput"><span class="keyword">true</span></code> if shared ownership - was obtained for the current thread, <code class="computeroutput"><span class="keyword">false</span></code>
- otherwise. - </p></dd> -<dt><span class="term">Postcondition:</span></dt> -<dd><p>- If the call returns <code class="computeroutput"><span class="keyword">true</span></code>, - the current thread has shared ownership of <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
- </p></dd> -<dt><span class="term">Throws:</span></dt> -<dd><p>- <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread_resource_error</span></code> if an error
- occurs. - </p></dd> -</dl> -</div> -</div> -<div class="section" lang="en"> -<div class="titlepage"><div><div><h5 class="title">-<a name="thread.synchronization.mutex_concepts.shared_lockable.timed_lock_shared"></a><a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.shared_lockable.timed_lock_shared" title="bool timed_lock_shared(boost::system_time const& abs_time)"> - <code class="computeroutput"><span class="keyword">bool</span> <span class="identifier">timed_lock_shared</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">system_time</span> - <span class="keyword">const</span><span class="special">&</span> - <span class="identifier">abs_time</span><span class="special">)</span></code></a>
-</h5></div></div></div> -<div class="variablelist"> -<p class="title"><b></b></p> -<dl> -<dt><span class="term">Effects:</span></dt> -<dd><p>- Attempt to obtain shared ownership for the current thread. Blocks - until shared ownership can be obtained, or the specified time is - reached. If the specified time has already passed, behaves as <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.shared_lockable.try_lock_shared" title="bool try_lock_shared()"><code class="computeroutput"><span class="identifier">try_lock_shared</span><span class="special">()</span></code></a>.
- </p></dd> -<dt><span class="term">Returns:</span></dt> -<dd><p>- <code class="computeroutput"><span class="keyword">true</span></code> if shared ownership - was acquired for the current thread, <code class="computeroutput"><span class="keyword">false</span></code>
- otherwise. - </p></dd> -<dt><span class="term">Postcondition:</span></dt> -<dd><p>- If the call returns <code class="computeroutput"><span class="keyword">true</span></code>, - the current thread has shared ownership of <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
- </p></dd> -<dt><span class="term">Throws:</span></dt> -<dd><p>- <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread_resource_error</span></code> if an error
- occurs. - </p></dd> -</dl> -</div> -</div> -<div class="section" lang="en"> -<div class="titlepage"><div><div><h5 class="title">-<a name="thread.synchronization.mutex_concepts.shared_lockable.unlock_shared"></a><a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.shared_lockable.unlock_shared" title="void unlock_shared()"> - <code class="computeroutput"><span class="keyword">void</span> <span class="identifier">unlock_shared</span><span class="special">()</span></code></a>
-</h5></div></div></div> -<div class="variablelist"> -<p class="title"><b></b></p> -<dl> -<dt><span class="term">Precondition:</span></dt> -<dd><p>- The current thread has shared ownership of <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
- </p></dd> -<dt><span class="term">Effects:</span></dt> -<dd><p>- Releases shared ownership of <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code> by the current thread.
- </p></dd> -<dt><span class="term">Postcondition:</span></dt> -<dd><p>- The current thread no longer has shared ownership of <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
- </p></dd> -<dt><span class="term">Throws:</span></dt> -<dd><p> - Nothing - </p></dd> -</dl> -</div> -</div> -</div> -<div class="section" lang="en"> -<div class="titlepage"><div><div><h4 class="title">-<a name="thread.synchronization.mutex_concepts.upgrade_lockable"></a><a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.upgrade_lockable" title="UpgradeLockable Concept"> - <code class="computeroutput"><span class="identifier">UpgradeLockable</span></code> Concept</a>
-</h4></div></div></div> -<div class="toc"><dl>-<dt><span class="section"><a href="synchronization.html#thread.synchronization.mutex_concepts.upgrade_lockable.lock_upgrade"> - <code class="computeroutput"><span class="keyword">void</span> <span class="identifier">lock_upgrade</span><span class="special">()</span></code></a></span></dt> -<dt><span class="section"><a href="synchronization.html#thread.synchronization.mutex_concepts.upgrade_lockable.unlock_upgrade"> - <code class="computeroutput"><span class="keyword">void</span> <span class="identifier">unlock_upgrade</span><span class="special">()</span></code></a></span></dt> -<dt><span class="section"><a href="synchronization.html#thread.synchronization.mutex_concepts.upgrade_lockable.unlock_upgrade_and_lock"> - <code class="computeroutput"><span class="keyword">void</span> <span class="identifier">unlock_upgrade_and_lock</span><span class="special">()</span></code></a></span></dt> -<dt><span class="section"><a href="synchronization.html#thread.synchronization.mutex_concepts.upgrade_lockable.unlock_upgrade_and_lock_shared"> - <code class="computeroutput"><span class="keyword">void</span> <span class="identifier">unlock_upgrade_and_lock_shared</span><span class="special">()</span></code></a></span></dt> -<dt><span class="section"><a href="synchronization.html#thread.synchronization.mutex_concepts.upgrade_lockable.unlock_and_lock_upgrade"> - <code class="computeroutput"><span class="keyword">void</span> <span class="identifier">unlock_and_lock_upgrade</span><span class="special">()</span></code></a></span></dt>
-</dl></div> -<p>- The <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.upgrade_lockable" title="UpgradeLockable Concept"><code class="computeroutput"><span class="identifier">UpgradeLockable</span></code> concept</a> is a refinement - of the <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.shared_lockable" title="SharedLockable Concept"><code class="computeroutput"><span class="identifier">SharedLockable</span></code> concept</a> that allows - for <span class="emphasis"><em>upgradable ownership</em></span> as well as <span class="emphasis"><em>shared - ownership</em></span> and <span class="emphasis"><em>exclusive ownership</em></span>. This - is an extension to the multiple-reader / single-write model provided by - the <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.shared_lockable" title="SharedLockable Concept"><code class="computeroutput"><span class="identifier">SharedLockable</span></code> concept</a>: a single - thread may have <span class="emphasis"><em>upgradable ownership</em></span> at the same time - as others have <span class="emphasis"><em>shared ownership</em></span>. The thread with - <span class="emphasis"><em>upgradable ownership</em></span> may at any time attempt to upgrade - that ownership to <span class="emphasis"><em>exclusive ownership</em></span>. If no other - threads have shared ownership, the upgrade is completed immediately, and - the thread now has <span class="emphasis"><em>exclusive ownership</em></span>, which must - be relinquished by a call to <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable.unlock" title="void unlock()"><code class="computeroutput"><span class="identifier">unlock</span><span class="special">()</span></code></a>, - just as if it had been acquired by a call to <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable.lock" title="void lock()"><code class="computeroutput"><span class="identifier">lock</span><span class="special">()</span></code></a>.
- </p> -<p>- If a thread with <span class="emphasis"><em>upgradable ownership</em></span> tries to upgrade - whilst other threads have <span class="emphasis"><em>shared ownership</em></span>, the attempt - will fail and the thread will block until <span class="emphasis"><em>exclusive ownership</em></span>
- can be acquired. - </p> -<p>- Ownership can also be <span class="emphasis"><em>downgraded</em></span> as well as <span class="emphasis"><em>upgraded</em></span>: - exclusive ownership of an implementation of the <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.upgrade_lockable" title="UpgradeLockable Concept"><code class="computeroutput"><span class="identifier">UpgradeLockable</span></code> concept</a> can be - downgraded to upgradable ownership or shared ownership, and upgradable
- ownership can be downgraded to plain shared ownership. - </p> -<p>- For a type to implement the <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.upgrade_lockable" title="UpgradeLockable Concept"><code class="computeroutput"><span class="identifier">UpgradeLockable</span></code> concept</a>, as well - as meeting the requirements of the <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.shared_lockable" title="SharedLockable Concept"><code class="computeroutput"><span class="identifier">SharedLockable</span></code> concept</a>, it must
- also provide the following member functions: - </p> -<div class="itemizedlist"><ul type="disc">-<li><a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.upgrade_lockable.lock_upgrade" title="void lock_upgrade()"><code class="computeroutput"><span class="keyword">void</span> <span class="identifier">lock_upgrade</span><span class="special">();</span></code></a></li> -<li><a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.upgrade_lockable.unlock_upgrade" title="void unlock_upgrade()"><code class="computeroutput"><span class="keyword">bool</span> <span class="identifier">unlock_upgrade</span><span class="special">();</span></code></a></li> -<li><a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.upgrade_lockable.unlock_upgrade_and_lock" title="void unlock_upgrade_and_lock()"><code class="computeroutput"><span class="keyword">void</span> <span class="identifier">unlock_upgrade_and_lock</span><span class="special">();</span></code></a></li> -<li><a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.upgrade_lockable.unlock_and_lock_upgrade" title="void unlock_and_lock_upgrade()"><code class="computeroutput"><span class="keyword">void</span> <span class="identifier">unlock_and_lock_upgrade</span><span class="special">();</span></code></a></li> -<li><a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.upgrade_lockable.unlock_upgrade_and_lock_shared" title="void unlock_upgrade_and_lock_shared()"><code class="computeroutput"><span class="keyword">void</span> <span class="identifier">unlock_upgrade_and_lock_shared</span><span class="special">();</span></code></a></li>
-</ul></div> -<p>- Lock ownership acquired through a call to <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.upgrade_lockable.lock_upgrade" title="void lock_upgrade()"><code class="computeroutput"><span class="identifier">lock_upgrade</span><span class="special">()</span></code></a> - must be released through a call to <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.upgrade_lockable.unlock_upgrade" title="void unlock_upgrade()"><code class="computeroutput"><span class="identifier">unlock_upgrade</span><span class="special">()</span></code></a>. - If the ownership type is changed through a call to one of the <code class="computeroutput"><span class="identifier">unlock_xxx_and_lock_yyy</span><span class="special">()</span></code> - functions, ownership must be released through a call to the unlock function
- corresponding to the new level of ownership. - </p> -<div class="section" lang="en"> -<div class="titlepage"><div><div><h5 class="title">-<a name="thread.synchronization.mutex_concepts.upgrade_lockable.lock_upgrade"></a><a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.upgrade_lockable.lock_upgrade" title="void lock_upgrade()"> - <code class="computeroutput"><span class="keyword">void</span> <span class="identifier">lock_upgrade</span><span class="special">()</span></code></a>
-</h5></div></div></div> -<div class="variablelist"> -<p class="title"><b></b></p> -<dl> -<dt><span class="term">Effects:</span></dt> -<dd><p>- The current thread blocks until upgrade ownership can be obtained
- for the current thread. - </p></dd> -<dt><span class="term">Postcondition:</span></dt> -<dd><p>- The current thread has upgrade ownership of <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
- </p></dd> -<dt><span class="term">Throws:</span></dt> -<dd><p>- <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread_resource_error</span></code> if an error
- occurs. - </p></dd> -</dl> -</div> -</div> -<div class="section" lang="en"> -<div class="titlepage"><div><div><h5 class="title">-<a name="thread.synchronization.mutex_concepts.upgrade_lockable.unlock_upgrade"></a><a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.upgrade_lockable.unlock_upgrade" title="void unlock_upgrade()"> - <code class="computeroutput"><span class="keyword">void</span> <span class="identifier">unlock_upgrade</span><span class="special">()</span></code></a>
-</h5></div></div></div> -<div class="variablelist"> -<p class="title"><b></b></p> -<dl> -<dt><span class="term">Precondition:</span></dt> -<dd><p>- The current thread has upgrade ownership of <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
- </p></dd> -<dt><span class="term">Effects:</span></dt> -<dd><p>- Releases upgrade ownership of <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code> by the current thread.
- </p></dd> -<dt><span class="term">Postcondition:</span></dt> -<dd><p>- The current thread no longer has upgrade ownership of <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
- </p></dd> -<dt><span class="term">Throws:</span></dt> -<dd><p> - Nothing - </p></dd> -</dl> -</div> -</div> -<div class="section" lang="en"> -<div class="titlepage"><div><div><h5 class="title">-<a name="thread.synchronization.mutex_concepts.upgrade_lockable.unlock_upgrade_and_lock"></a><a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.upgrade_lockable.unlock_upgrade_and_lock" title="void unlock_upgrade_and_lock()"> - <code class="computeroutput"><span class="keyword">void</span> <span class="identifier">unlock_upgrade_and_lock</span><span class="special">()</span></code></a>
-</h5></div></div></div> -<div class="variablelist"> -<p class="title"><b></b></p> -<dl> -<dt><span class="term">Precondition:</span></dt> -<dd><p>- The current thread has upgrade ownership of <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
- </p></dd> -<dt><span class="term">Effects:</span></dt> -<dd><p>- Atomically releases upgrade ownership of <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code> by the current thread and acquires - exclusive ownership of <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>. If any other threads have shared - ownership, blocks until exclusive ownership can be acquired.
- </p></dd> -<dt><span class="term">Postcondition:</span></dt> -<dd><p>- The current thread has exclusive ownership of <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
- </p></dd> -<dt><span class="term">Throws:</span></dt> -<dd><p> - Nothing - </p></dd> -</dl> -</div> -</div> -<div class="section" lang="en"> -<div class="titlepage"><div><div><h5 class="title">-<a name="thread.synchronization.mutex_concepts.upgrade_lockable.unlock_upgrade_and_lock_shared"></a><a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.upgrade_lockable.unlock_upgrade_and_lock_shared" title="void unlock_upgrade_and_lock_shared()"> - <code class="computeroutput"><span class="keyword">void</span> <span class="identifier">unlock_upgrade_and_lock_shared</span><span class="special">()</span></code></a>
-</h5></div></div></div> -<div class="variablelist"> -<p class="title"><b></b></p> -<dl> -<dt><span class="term">Precondition:</span></dt> -<dd><p>- The current thread has upgrade ownership of <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
- </p></dd> -<dt><span class="term">Effects:</span></dt> -<dd><p>- Atomically releases upgrade ownership of <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code> by the current thread and acquires - shared ownership of <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code> without blocking.
- </p></dd> -<dt><span class="term">Postcondition:</span></dt> -<dd><p>- The current thread has shared ownership of <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
- </p></dd> -<dt><span class="term">Throws:</span></dt> -<dd><p> - Nothing - </p></dd> -</dl> -</div> -</div> -<div class="section" lang="en"> -<div class="titlepage"><div><div><h5 class="title">-<a name="thread.synchronization.mutex_concepts.upgrade_lockable.unlock_and_lock_upgrade"></a><a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.upgrade_lockable.unlock_and_lock_upgrade" title="void unlock_and_lock_upgrade()"> - <code class="computeroutput"><span class="keyword">void</span> <span class="identifier">unlock_and_lock_upgrade</span><span class="special">()</span></code></a>
-</h5></div></div></div> -<div class="variablelist"> -<p class="title"><b></b></p> -<dl> -<dt><span class="term">Precondition:</span></dt> -<dd><p>- The current thread has exclusive ownership of <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
- </p></dd> -<dt><span class="term">Effects:</span></dt> -<dd><p>- Atomically releases exclusive ownership of <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code> by the current thread and acquires - upgrade ownership of <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code> without blocking.
- </p></dd> -<dt><span class="term">Postcondition:</span></dt> -<dd><p>- The current thread has upgrade ownership of <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
- </p></dd> -<dt><span class="term">Throws:</span></dt> -<dd><p> - Nothing - </p></dd> -</dl> -</div> -</div> -</div> -</div> -<div class="section" lang="en"> -<div class="titlepage"><div><div><h3 class="title">-<a name="thread.synchronization.locks"></a><a class="link" href="synchronization.html#thread.synchronization.locks" title="Lock Types"> Lock Types</a>
-</h3></div></div></div> -<div class="toc"><dl>-<dt><span class="section"><a href="synchronization.html#thread.synchronization.locks.lock_guard"> Class template - <code class="computeroutput"><span class="identifier">lock_guard</span></code></a></span></dt> -<dt><span class="section"><a href="synchronization.html#thread.synchronization.locks.unique_lock"> Class template - <code class="computeroutput"><span class="identifier">unique_lock</span></code></a></span></dt> -<dt><span class="section"><a href="synchronization.html#thread.synchronization.locks.shared_lock"> Class template - <code class="computeroutput"><span class="identifier">shared_lock</span></code></a></span></dt> -<dt><span class="section"><a href="synchronization.html#thread.synchronization.locks.upgrade_lock"> Class template - <code class="computeroutput"><span class="identifier">upgrade_lock</span></code></a></span></dt> -<dt><span class="section"><a href="synchronization.html#thread.synchronization.locks.upgrade_to_unique_lock"> - Class template <code class="computeroutput"><span class="identifier">upgrade_to_unique_lock</span></code></a></span></dt> -<dt><span class="section"><a href="synchronization.html#thread.synchronization.locks.scoped_try_lock"> Mutex-specific - class <code class="computeroutput"><span class="identifier">scoped_try_lock</span></code></a></span></dt>
-</dl></div> -<div class="section" lang="en"> -<div class="titlepage"><div><div><h4 class="title">-<a name="thread.synchronization.locks.lock_guard"></a><a class="link" href="synchronization.html#thread.synchronization.locks.lock_guard" title="Class template lock_guard"> Class template - <code class="computeroutput"><span class="identifier">lock_guard</span></code></a>
-</h4></div></div></div> -<div class="toc"><dl>-<dt><span class="section"><a href="synchronization.html#thread.synchronization.locks.lock_guard.constructor"> - <code class="computeroutput"><span class="identifier">lock_guard</span><span class="special">(</span><span class="identifier">Lockable</span> <span class="special">&</span> - <span class="identifier">m</span><span class="special">)</span></code></a></span></dt> -<dt><span class="section"><a href="synchronization.html#thread.synchronization.locks.lock_guard.constructor_adopt"> - <code class="computeroutput"><span class="identifier">lock_guard</span><span class="special">(</span><span class="identifier">Lockable</span> <span class="special">&</span> - <span class="identifier">m</span><span class="special">,</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">adopt_lock_t</span><span class="special">)</span></code></a></span></dt> -<dt><span class="section"><a href="synchronization.html#thread.synchronization.locks.lock_guard.destructor"> - <code class="computeroutput"><span class="special">~</span><span class="identifier">lock_guard</span><span class="special">()</span></code></a></span></dt>
-</dl></div>-<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">thread</span><span class="special">/</span><span class="identifier">locks</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
--<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Lockable</span><span class="special">></span> -<span class="keyword">class</span> <span class="identifier">lock_guard</span>
-<span class="special">{</span> -<span class="keyword">public</span><span class="special">:</span>- <span class="keyword">explicit</span> <span class="identifier">lock_guard</span><span class="special">(</span><span class="identifier">Lockable</span><span class="special">&</span> <span class="identifier">m_</span><span class="special">);</span> - <span class="identifier">lock_guard</span><span class="special">(</span><span class="identifier">Lockable</span><span class="special">&</span> <span class="identifier">m_</span><span class="special">,</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">adopt_lock_t</span><span class="special">);</span>
-- <span class="special">~</span><span class="identifier">lock_guard</span><span class="special">();</span>
-<span class="special">};</span> -</pre> -<p>- <a class="link" href="synchronization.html#thread.synchronization.locks.lock_guard" title="Class template lock_guard"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">lock_guard</span></code></a> - is very simple: on construction it acquires ownership of the implementation - of the <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable" title="Lockable Concept"><code class="computeroutput"><span class="identifier">Lockable</span></code> concept</a> supplied as the - constructor parameter. On destruction, the ownership is released. This - provides simple RAII-style locking of a <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable" title="Lockable Concept"><code class="computeroutput"><span class="identifier">Lockable</span></code></a> object, to facilitate - exception-safe locking and unlocking. In addition, the <a class="link" href="synchronization.html#thread.synchronization.locks.lock_guard.constructor_adopt" title="lock_guard(Lockable & m,boost::adopt_lock_t)"><code class="computeroutput"><span class="identifier">lock_guard</span><span class="special">(</span><span class="identifier">Lockable</span> <span class="special">&</span> - <span class="identifier">m</span><span class="special">,</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">adopt_lock_t</span><span class="special">)</span></code> - constructor</a> allows the <a class="link" href="synchronization.html#thread.synchronization.locks.lock_guard" title="Class template lock_guard"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">lock_guard</span></code></a> object to take ownership
- of a lock already held by the current thread. - </p> -<div class="section" lang="en"> -<div class="titlepage"><div><div><h5 class="title">-<a name="thread.synchronization.locks.lock_guard.constructor"></a><a class="link" href="synchronization.html#thread.synchronization.locks.lock_guard.constructor" title="lock_guard(Lockable & m)"> - <code class="computeroutput"><span class="identifier">lock_guard</span><span class="special">(</span><span class="identifier">Lockable</span> <span class="special">&</span> - <span class="identifier">m</span><span class="special">)</span></code></a>
-</h5></div></div></div> -<div class="variablelist"> -<p class="title"><b></b></p> -<dl> -<dt><span class="term">Effects:</span></dt> -<dd><p>- Stores a reference to <code class="computeroutput"><span class="identifier">m</span></code>. - Invokes <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable.lock" title="void lock()"><code class="computeroutput"><span class="identifier">m</span><span class="special">.</span><span class="identifier">lock</span><span class="special">()</span></code></a>.
- </p></dd> -<dt><span class="term">Throws:</span></dt> -<dd><p>- Any exception thrown by the call to <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable.lock" title="void lock()"><code class="computeroutput"><span class="identifier">m</span><span class="special">.</span><span class="identifier">lock</span><span class="special">()</span></code></a>.
- </p></dd> -</dl> -</div> -</div> -<div class="section" lang="en"> -<div class="titlepage"><div><div><h5 class="title">-<a name="thread.synchronization.locks.lock_guard.constructor_adopt"></a><a class="link" href="synchronization.html#thread.synchronization.locks.lock_guard.constructor_adopt" title="lock_guard(Lockable & m,boost::adopt_lock_t)"> - <code class="computeroutput"><span class="identifier">lock_guard</span><span class="special">(</span><span class="identifier">Lockable</span> <span class="special">&</span> - <span class="identifier">m</span><span class="special">,</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">adopt_lock_t</span><span class="special">)</span></code></a>
-</h5></div></div></div> -<div class="variablelist"> -<p class="title"><b></b></p> -<dl> -<dt><span class="term">Precondition:</span></dt> -<dd><p>- The current thread owns a lock on <code class="computeroutput"><span class="identifier">m</span></code> - equivalent to one obtained by a call to <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable.lock" title="void lock()"><code class="computeroutput"><span class="identifier">m</span><span class="special">.</span><span class="identifier">lock</span><span class="special">()</span></code></a>.
- </p></dd> -<dt><span class="term">Effects:</span></dt> -<dd><p>- Stores a reference to <code class="computeroutput"><span class="identifier">m</span></code>. - Takes ownership of the lock state of <code class="computeroutput"><span class="identifier">m</span></code>.
- </p></dd> -<dt><span class="term">Throws:</span></dt> -<dd><p> - Nothing. - </p></dd> -</dl> -</div> -</div> -<div class="section" lang="en"> -<div class="titlepage"><div><div><h5 class="title">-<a name="thread.synchronization.locks.lock_guard.destructor"></a><a class="link" href="synchronization.html#thread.synchronization.locks.lock_guard.destructor" title="~lock_guard()"> - <code class="computeroutput"><span class="special">~</span><span class="identifier">lock_guard</span><span class="special">()</span></code></a>
-</h5></div></div></div> -<div class="variablelist"> -<p class="title"><b></b></p> -<dl> -<dt><span class="term">Effects:</span></dt> -<dd><p>- Invokes <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable.unlock" title="void unlock()"><code class="computeroutput"><span class="identifier">m</span><span class="special">.</span><span class="identifier">unlock</span><span class="special">()</span></code></a> - on the <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable" title="Lockable Concept"><code class="computeroutput"><span class="identifier">Lockable</span></code></a> object passed to
- the constructor. - </p></dd> -<dt><span class="term">Throws:</span></dt> -<dd><p> - Nothing. - </p></dd> -</dl> -</div> -</div> -</div> -<div class="section" lang="en"> -<div class="titlepage"><div><div><h4 class="title">-<a name="thread.synchronization.locks.unique_lock"></a><a class="link" href="synchronization.html#thread.synchronization.locks.unique_lock" title="Class template unique_lock"> Class template - <code class="computeroutput"><span class="identifier">unique_lock</span></code></a>
-</h4></div></div></div> -<div class="toc"><dl>-<dt><span class="section"><a href="synchronization.html#thread.synchronization.locks.unique_lock.defaultconstructor"> - <code class="computeroutput"><span class="identifier">unique_lock</span><span class="special">()</span></code></a></span></dt> -<dt><span class="section"><a href="synchronization.html#thread.synchronization.locks.unique_lock.constructor"> - <code class="computeroutput"><span class="identifier">unique_lock</span><span class="special">(</span><span class="identifier">Lockable</span> <span class="special">&</span> - <span class="identifier">m</span><span class="special">)</span></code></a></span></dt> -<dt><span class="section"><a href="synchronization.html#thread.synchronization.locks.unique_lock.constructor_adopt"> - <code class="computeroutput"><span class="identifier">unique_lock</span><span class="special">(</span><span class="identifier">Lockable</span> <span class="special">&</span> - <span class="identifier">m</span><span class="special">,</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">adopt_lock_t</span><span class="special">)</span></code></a></span></dt> -<dt><span class="section"><a href="synchronization.html#thread.synchronization.locks.unique_lock.constructor_defer"> - <code class="computeroutput"><span class="identifier">unique_lock</span><span class="special">(</span><span class="identifier">Lockable</span> <span class="special">&</span> - <span class="identifier">m</span><span class="special">,</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">defer_lock_t</span><span class="special">)</span></code></a></span></dt> -<dt><span class="section"><a href="synchronization.html#thread.synchronization.locks.unique_lock.constructor_try"> - <code class="computeroutput"><span class="identifier">unique_lock</span><span class="special">(</span><span class="identifier">Lockable</span> <span class="special">&</span> - <span class="identifier">m</span><span class="special">,</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">try_to_lock_t</span><span class="special">)</span></code></a></span></dt> -<dt><span class="section"><a href="synchronization.html#thread.synchronization.locks.unique_lock.constructor_abs_time"> - <code class="computeroutput"><span class="identifier">unique_lock</span><span class="special">(</span><span class="identifier">Lockable</span> <span class="special">&</span> - <span class="identifier">m</span><span class="special">,</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">system_time</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">abs_time</span><span class="special">)</span></code></a></span></dt> -<dt><span class="section"><a href="synchronization.html#thread.synchronization.locks.unique_lock.destructor"> - <code class="computeroutput"><span class="special">~</span><span class="identifier">unique_lock</span><span class="special">()</span></code></a></span></dt> -<dt><span class="section"><a href="synchronization.html#thread.synchronization.locks.unique_lock.owns_lock"> - <code class="computeroutput"><span class="keyword">bool</span> <span class="identifier">owns_lock</span><span class="special">()</span> <span class="keyword">const</span></code></a></span></dt> -<dt><span class="section"><a href="synchronization.html#thread.synchronization.locks.unique_lock.mutex"> - <code class="computeroutput"><span class="identifier">Lockable</span><span class="special">*</span> - <span class="identifier">mutex</span><span class="special">()</span>
- <span class="keyword">const</span></code></a></span></dt>-<dt><span class="section"><a href="synchronization.html#thread.synchronization.locks.unique_lock.bool_conversion"> - <code class="computeroutput"><span class="keyword">operator</span> <span class="identifier">unspecified</span><span class="special">-</span><span class="keyword">bool</span><span class="special">-</span><span class="identifier">type</span><span class="special">()</span> <span class="keyword">const</span></code></a></span></dt> -<dt><span class="section"><a href="synchronization.html#thread.synchronization.locks.unique_lock.operator_not"> - <code class="computeroutput"><span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">!()</span> <span class="keyword">const</span></code></a></span></dt> -<dt><span class="section"><a href="synchronization.html#thread.synchronization.locks.unique_lock.release"> - <code class="computeroutput"><span class="identifier">Lockable</span><span class="special">*</span> - <span class="identifier">release</span><span class="special">()</span></code></a></span></dt>
-</dl></div>-<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">thread</span><span class="special">/</span><span class="identifier">locks</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
--<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Lockable</span><span class="special">></span> -<span class="keyword">class</span> <span class="identifier">unique_lock</span>
-<span class="special">{</span> -<span class="keyword">public</span><span class="special">:</span>- <span class="identifier">unique_lock</span><span class="special">();</span> - <span class="keyword">explicit</span> <span class="identifier">unique_lock</span><span class="special">(</span><span class="identifier">Lockable</span><span class="special">&</span> <span class="identifier">m_</span><span class="special">);</span> - <span class="identifier">unique_lock</span><span class="special">(</span><span class="identifier">Lockable</span><span class="special">&</span> <span class="identifier">m_</span><span class="special">,</span><span class="identifier">adopt_lock_t</span><span class="special">);</span> - <span class="identifier">unique_lock</span><span class="special">(</span><span class="identifier">Lockable</span><span class="special">&</span> <span class="identifier">m_</span><span class="special">,</span><span class="identifier">defer_lock_t</span><span class="special">);</span> - <span class="identifier">unique_lock</span><span class="special">(</span><span class="identifier">Lockable</span><span class="special">&</span> <span class="identifier">m_</span><span class="special">,</span><span class="identifier">try_to_lock_t</span><span class="special">);</span> - <span class="identifier">unique_lock</span><span class="special">(</span><span class="identifier">Lockable</span><span class="special">&</span> <span class="identifier">m_</span><span class="special">,</span><span class="identifier">system_time</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">target_time</span><span class="special">);</span>
-- <span class="special">~</span><span class="identifier">unique_lock</span><span class="special">();</span>
-- <span class="identifier">unique_lock</span><span class="special">(</span><span class="identifier">detail</span><span class="special">::</span><span class="identifier">thread_move_t</span><span class="special"><</span><span class="identifier">unique_lock</span><span class="special"><</span><span class="identifier">Lockable</span><span class="special">></span> <span class="special">></span> <span class="identifier">other</span><span class="special">);</span> - <span class="identifier">unique_lock</span><span class="special">(</span><span class="identifier">detail</span><span class="special">::</span><span class="identifier">thread_move_t</span><span class="special"><</span><span class="identifier">upgrade_lock</span><span class="special"><</span><span class="identifier">Lockable</span><span class="special">></span> <span class="special">></span> <span class="identifier">other</span><span class="special">);</span>
-- <span class="keyword">operator</span> <span class="identifier">detail</span><span class="special">::</span><span class="identifier">thread_move_t</span><span class="special"><</span><span class="identifier">unique_lock</span><span class="special"><</span><span class="identifier">Lockable</span><span class="special">></span> <span class="special">>();</span> - <span class="identifier">detail</span><span class="special">::</span><span class="identifier">thread_move_t</span><span class="special"><</span><span class="identifier">unique_lock</span><span class="special"><</span><span class="identifier">Lockable</span><span class="special">></span> <span class="special">></span> <span class="identifier">move</span><span class="special">();</span> - <span class="identifier">unique_lock</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">=(</span><span class="identifier">detail</span><span class="special">::</span><span class="identifier">thread_move_t</span><span class="special"><</span><span class="identifier">unique_lock</span><span class="special"><</span><span class="identifier">Lockable</span><span class="special">></span> <span class="special">></span> <span class="identifier">other</span><span class="special">);</span> - <span class="identifier">unique_lock</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">=(</span><span class="identifier">detail</span><span class="special">::</span><span class="identifier">thread_move_t</span><span class="special"><</span><span class="identifier">upgrade_lock</span><span class="special"><</span><span class="identifier">Lockable</span><span class="special">></span> <span class="special">></span> <span class="identifier">other</span><span class="special">);</span>
-- <span class="keyword">void</span> <span class="identifier">swap</span><span class="special">(</span><span class="identifier">unique_lock</span><span class="special">&</span> <span class="identifier">other</span><span class="special">);</span> - <span class="keyword">void</span> <span class="identifier">swap</span><span class="special">(</span><span class="identifier">detail</span><span class="special">::</span><span class="identifier">thread_move_t</span><span class="special"><</span><span class="identifier">unique_lock</span><span class="special"><</span><span class="identifier">Lockable</span><span class="special">></span> <span class="special">></span> <span class="identifier">other</span><span class="special">);</span>
-- <span class="keyword">void</span> <span class="identifier">lock</span><span class="special">();</span> - <span class="keyword">bool</span> <span class="identifier">try_lock</span><span class="special">();</span>
-- <span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">TimeDuration</span><span class="special">></span> - <span class="keyword">bool</span> <span class="identifier">timed_lock</span><span class="special">(</span><span class="identifier">TimeDuration</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">relative_time</span><span class="special">);</span> - <span class="keyword">bool</span> <span class="identifier">timed_lock</span><span class="special">(::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">system_time</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">absolute_time</span><span class="special">);</span>
-- <span class="keyword">void</span> <span class="identifier">unlock</span><span class="special">();</span>
-- <span class="keyword">bool</span> <span class="identifier">owns_lock</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span> - <span class="keyword">operator</span> <span class="emphasis"><em>unspecified-bool-type</em></span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span> - <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">!()</span> <span class="keyword">const</span><span class="special">;</span>
-- <span class="identifier">Lockable</span><span class="special">*</span> <span class="identifier">mutex</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span> - <span class="identifier">Lockable</span><span class="special">*</span> <span class="identifier">release</span><span class="special">();</span>
-<span class="special">};</span> -</pre> -<p>- <a class="link" href="synchronization.html#thread.synchronization.locks.unique_lock" title="Class template unique_lock"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">unique_lock</span></code></a> is more complex than - <a class="link" href="synchronization.html#thread.synchronization.locks.lock_guard" title="Class template lock_guard"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">lock_guard</span></code></a>: - not only does it provide for RAII-style locking, it also allows for deferring - acquiring the lock until the <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable.lock" title="void lock()"><code class="computeroutput"><span class="identifier">lock</span><span class="special">()</span></code></a> - member function is called explicitly, or trying to acquire the lock in - a non-blocking fashion, or with a timeout. Consequently, <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable.unlock" title="void unlock()"><code class="computeroutput"><span class="identifier">unlock</span><span class="special">()</span></code></a> - is only called in the destructor if the lock object has locked the <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable" title="Lockable Concept"><code class="computeroutput"><span class="identifier">Lockable</span></code></a> object, or otherwise - adopted a lock on the <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable" title="Lockable Concept"><code class="computeroutput"><span class="identifier">Lockable</span></code></a> object.
- </p> -<p>- Specializations of <a class="link" href="synchronization.html#thread.synchronization.locks.unique_lock" title="Class template unique_lock"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">unique_lock</span></code></a> model the <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.timed_lockable" title="TimedLockable Concept"><code class="computeroutput"><span class="identifier">TimedLockable</span></code> concept</a> if the supplied - <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable" title="Lockable Concept"><code class="computeroutput"><span class="identifier">Lockable</span></code></a> type itself models <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.timed_lockable" title="TimedLockable Concept"><code class="computeroutput"><span class="identifier">TimedLockable</span></code> concept</a> (e.g. <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">unique_lock</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">timed_mutex</span><span class="special">></span></code>), - or the <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable" title="Lockable Concept"><code class="computeroutput"><span class="identifier">Lockable</span></code> concept</a> otherwise (e.g. - <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">unique_lock</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">mutex</span><span class="special">></span></code>).
- </p> -<p>- An instance of <a class="link" href="synchronization.html#thread.synchronization.locks.unique_lock" title="Class template unique_lock"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">unique_lock</span></code></a> is said to <span class="emphasis"><em>own</em></span> - the lock state of a <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable" title="Lockable Concept"><code class="computeroutput"><span class="identifier">Lockable</span></code></a> <code class="computeroutput"><span class="identifier">m</span></code> - if <a class="link" href="synchronization.html#thread.synchronization.locks.unique_lock.mutex" title="Lockable* mutex() const"><code class="computeroutput"><span class="identifier">mutex</span><span class="special">()</span></code></a> - returns a pointer to <code class="computeroutput"><span class="identifier">m</span></code> - and <a class="link" href="synchronization.html#thread.synchronization.locks.unique_lock.owns_lock" title="bool owns_lock() const"><code class="computeroutput"><span class="identifier">owns_lock</span><span class="special">()</span></code></a> - returns <code class="computeroutput"><span class="keyword">true</span></code>. If an object - that <span class="emphasis"><em>owns</em></span> the lock state of a <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable" title="Lockable Concept"><code class="computeroutput"><span class="identifier">Lockable</span></code></a> object is destroyed, - then the destructor will invoke <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable.unlock" title="void unlock()"><code class="computeroutput"><span class="identifier">mutex</span><span class="special">()-></span><span class="identifier">unlock</span><span class="special">()</span></code></a>.
- </p> -<p>- The member functions of <a class="link" href="synchronization.html#thread.synchronization.locks.unique_lock" title="Class template unique_lock"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">unique_lock</span></code></a> are not thread-safe. - In particular, <a class="link" href="synchronization.html#thread.synchronization.locks.unique_lock" title="Class template unique_lock"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">unique_lock</span></code></a> is intended to model - the ownership of a <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable" title="Lockable Concept"><code class="computeroutput"><span class="identifier">Lockable</span></code></a> object by a particular - thread, and the member functions that release ownership of the lock state - (including the destructor) must be called by the same thread that acquired
- ownership of the lock state. - </p> -<div class="section" lang="en"> -<div class="titlepage"><div><div><h5 class="title">-<a name="thread.synchronization.locks.unique_lock.defaultconstructor"></a><a class="link" href="synchronization.html#thread.synchronization.locks.unique_lock.defaultconstructor" title="unique_lock()"> - <code class="computeroutput"><span class="identifier">unique_lock</span><span class="special">()</span></code></a>
-</h5></div></div></div> -<div class="variablelist"> -<p class="title"><b></b></p> -<dl> -<dt><span class="term">Effects:</span></dt> -<dd><p> - Creates a lock object with no associated mutex. - </p></dd> -<dt><span class="term">Postcondition:</span></dt> -<dd><p>- <a class="link" href="synchronization.html#thread.synchronization.locks.unique_lock.owns_lock" title="bool owns_lock() const"><code class="computeroutput"><span class="identifier">owns_lock</span><span class="special">()</span></code></a> - returns <code class="computeroutput"><span class="keyword">false</span></code>. <a class="link" href="synchronization.html#thread.synchronization.locks.unique_lock.mutex" title="Lockable* mutex() const"><code class="computeroutput"><span class="identifier">mutex</span><span class="special">()</span></code></a> - returns <code class="computeroutput"><span class="identifier">NULL</span></code>.
- </p></dd> -<dt><span class="term">Throws:</span></dt> -<dd><p> - Nothing. - </p></dd> -</dl> -</div> -</div> -<div class="section" lang="en"> -<div class="titlepage"><div><div><h5 class="title">-<a name="thread.synchronization.locks.unique_lock.constructor"></a><a class="link" href="synchronization.html#thread.synchronization.locks.unique_lock.constructor" title="unique_lock(Lockable & m)"> - <code class="computeroutput"><span class="identifier">unique_lock</span><span class="special">(</span><span class="identifier">Lockable</span> <span class="special">&</span> - <span class="identifier">m</span><span class="special">)</span></code></a>
-</h5></div></div></div> -<div class="variablelist"> -<p class="title"><b></b></p> -<dl> -<dt><span class="term">Effects:</span></dt> -<dd><p>- Stores a reference to <code class="computeroutput"><span class="identifier">m</span></code>. - Invokes <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable.lock" title="void lock()"><code class="computeroutput"><span class="identifier">m</span><span class="special">.</span><span class="identifier">lock</span><span class="special">()</span></code></a>.
- </p></dd> -<dt><span class="term">Postcondition:</span></dt> -<dd><p>- <a class="link" href="synchronization.html#thread.synchronization.locks.unique_lock.owns_lock" title="bool owns_lock() const"><code class="computeroutput"><span class="identifier">owns_lock</span><span class="special">()</span></code></a> - returns <code class="computeroutput"><span class="keyword">true</span></code>. <a class="link" href="synchronization.html#thread.synchronization.locks.unique_lock.mutex" title="Lockable* mutex() const"><code class="computeroutput"><span class="identifier">mutex</span><span class="special">()</span></code></a> - returns <code class="computeroutput"><span class="special">&</span><span class="identifier">m</span></code>.
- </p></dd> -<dt><span class="term">Throws:</span></dt> -<dd><p>- Any exception thrown by the call to <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable.lock" title="void lock()"><code class="computeroutput"><span class="identifier">m</span><span class="special">.</span><span class="identifier">lock</span><span class="special">()</span></code></a>.
- </p></dd> -</dl> -</div> -</div> -<div class="section" lang="en"> -<div class="titlepage"><div><div><h5 class="title">-<a name="thread.synchronization.locks.unique_lock.constructor_adopt"></a><a class="link" href="synchronization.html#thread.synchronization.locks.unique_lock.constructor_adopt" title="unique_lock(Lockable & m,boost::adopt_lock_t)"> - <code class="computeroutput"><span class="identifier">unique_lock</span><span class="special">(</span><span class="identifier">Lockable</span> <span class="special">&</span> - <span class="identifier">m</span><span class="special">,</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">adopt_lock_t</span><span class="special">)</span></code></a>
-</h5></div></div></div> -<div class="variablelist"> -<p class="title"><b></b></p> -<dl> -<dt><span class="term">Precondition:</span></dt> -<dd><p>- The current thread owns an exclusive lock on <code class="computeroutput"><span class="identifier">m</span></code>.
- </p></dd> -<dt><span class="term">Effects:</span></dt> -<dd><p>- Stores a reference to <code class="computeroutput"><span class="identifier">m</span></code>. - Takes ownership of the lock state of <code class="computeroutput"><span class="identifier">m</span></code>.
- </p></dd> -<dt><span class="term">Postcondition:</span></dt> -<dd><p>- <a class="link" href="synchronization.html#thread.synchronization.locks.unique_lock.owns_lock" title="bool owns_lock() const"><code class="computeroutput"><span class="identifier">owns_lock</span><span class="special">()</span></code></a> - returns <code class="computeroutput"><span class="keyword">true</span></code>. <a class="link" href="synchronization.html#thread.synchronization.locks.unique_lock.mutex" title="Lockable* mutex() const"><code class="computeroutput"><span class="identifier">mutex</span><span class="special">()</span></code></a> - returns <code class="computeroutput"><span class="special">&</span><span class="identifier">m</span></code>.
- </p></dd> -<dt><span class="term">Throws:</span></dt> -<dd><p> - Nothing. - </p></dd> -</dl> -</div> -</div> -<div class="section" lang="en"> -<div class="titlepage"><div><div><h5 class="title">-<a name="thread.synchronization.locks.unique_lock.constructor_defer"></a><a class="link" href="synchronization.html#thread.synchronization.locks.unique_lock.constructor_defer" title="unique_lock(Lockable & m,boost::defer_lock_t)"> - <code class="computeroutput"><span class="identifier">unique_lock</span><span class="special">(</span><span class="identifier">Lockable</span> <span class="special">&</span> - <span class="identifier">m</span><span class="special">,</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">defer_lock_t</span><span class="special">)</span></code></a>
-</h5></div></div></div> -<div class="variablelist"> -<p class="title"><b></b></p> -<dl> -<dt><span class="term">Effects:</span></dt> -<dd><p>- Stores a reference to <code class="computeroutput"><span class="identifier">m</span></code>.
- </p></dd> -<dt><span class="term">Postcondition:</span></dt> -<dd><p>- <a class="link" href="synchronization.html#thread.synchronization.locks.unique_lock.owns_lock" title="bool owns_lock() const"><code class="computeroutput"><span class="identifier">owns_lock</span><span class="special">()</span></code></a> - returns <code class="computeroutput"><span class="keyword">false</span></code>. <a class="link" href="synchronization.html#thread.synchronization.locks.unique_lock.mutex" title="Lockable* mutex() const"><code class="computeroutput"><span class="identifier">mutex</span><span class="special">()</span></code></a> - returns <code class="computeroutput"><span class="special">&</span><span class="identifier">m</span></code>.
- </p></dd> -<dt><span class="term">Throws:</span></dt> -<dd><p> - Nothing. - </p></dd> -</dl> -</div> -</div> -<div class="section" lang="en"> -<div class="titlepage"><div><div><h5 class="title">-<a name="thread.synchronization.locks.unique_lock.constructor_try"></a><a class="link" href="synchronization.html#thread.synchronization.locks.unique_lock.constructor_try" title="unique_lock(Lockable & m,boost::try_to_lock_t)"> - <code class="computeroutput"><span class="identifier">unique_lock</span><span class="special">(</span><span class="identifier">Lockable</span> <span class="special">&</span> - <span class="identifier">m</span><span class="special">,</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">try_to_lock_t</span><span class="special">)</span></code></a>
-</h5></div></div></div> -<div class="variablelist"> -<p class="title"><b></b></p> -<dl> -<dt><span class="term">Effects:</span></dt> -<dd><p>- Stores a reference to <code class="computeroutput"><span class="identifier">m</span></code>. - Invokes <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable.try_lock" title="bool try_lock()"><code class="computeroutput"><span class="identifier">m</span><span class="special">.</span><span class="identifier">try_lock</span><span class="special">()</span></code></a>, - and takes ownership of the lock state if the call returns <code class="computeroutput"><span class="keyword">true</span></code>.
- </p></dd> -<dt><span class="term">Postcondition:</span></dt> -<dd><p>- <a class="link" href="synchronization.html#thread.synchronization.locks.unique_lock.mutex" title="Lockable* mutex() const"><code class="computeroutput"><span class="identifier">mutex</span><span class="special">()</span></code></a> - returns <code class="computeroutput"><span class="special">&</span><span class="identifier">m</span></code>. - If the call to <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable.try_lock" title="bool try_lock()"><code class="computeroutput"><span class="identifier">try_lock</span><span class="special">()</span></code></a> - returned <code class="computeroutput"><span class="keyword">true</span></code>, then - <a class="link" href="synchronization.html#thread.synchronization.locks.unique_lock.owns_lock" title="bool owns_lock() const"><code class="computeroutput"><span class="identifier">owns_lock</span><span class="special">()</span></code></a> - returns <code class="computeroutput"><span class="keyword">true</span></code>, otherwise - <a class="link" href="synchronization.html#thread.synchronization.locks.unique_lock.owns_lock" title="bool owns_lock() const"><code class="computeroutput"><span class="identifier">owns_lock</span><span class="special">()</span></code></a> - returns <code class="computeroutput"><span class="keyword">false</span></code>.
- </p></dd> -<dt><span class="term">Throws:</span></dt> -<dd><p> - Nothing. - </p></dd> -</dl> -</div> -</div> -<div class="section" lang="en"> -<div class="titlepage"><div><div><h5 class="title">-<a name="thread.synchronization.locks.unique_lock.constructor_abs_time"></a><a class="link" href="synchronization.html#thread.synchronization.locks.unique_lock.constructor_abs_time" title="unique_lock(Lockable & m,boost::system_time const& abs_time)"> - <code class="computeroutput"><span class="identifier">unique_lock</span><span class="special">(</span><span class="identifier">Lockable</span> <span class="special">&</span> - <span class="identifier">m</span><span class="special">,</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">system_time</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">abs_time</span><span class="special">)</span></code></a>
-</h5></div></div></div> -<div class="variablelist"> -<p class="title"><b></b></p> -<dl> -<dt><span class="term">Effects:</span></dt> -<dd><p>- Stores a reference to <code class="computeroutput"><span class="identifier">m</span></code>. - Invokes <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.timed_lockable.timed_lock" title="bool timed_lock(boost::system_time const& abs_time)"><code class="computeroutput"><span class="identifier">m</span><span class="special">.</span><span class="identifier">timed_lock</span><span class="special">(</span><span class="identifier">abs_time</span><span class="special">)</span></code></a>, - and takes ownership of the lock state if the call returns <code class="computeroutput"><span class="keyword">true</span></code>.
- </p></dd> -<dt><span class="term">Postcondition:</span></dt> -<dd><p>- <a class="link" href="synchronization.html#thread.synchronization.locks.unique_lock.mutex" title="Lockable* mutex() const"><code class="computeroutput"><span class="identifier">mutex</span><span class="special">()</span></code></a> - returns <code class="computeroutput"><span class="special">&</span><span class="identifier">m</span></code>. - If the call to <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.timed_lockable.timed_lock" title="bool timed_lock(boost::system_time const& abs_time)"><code class="computeroutput"><span class="identifier">timed_lock</span><span class="special">()</span></code></a> - returned <code class="computeroutput"><span class="keyword">true</span></code>, then - <a class="link" href="synchronization.html#thread.synchronization.locks.unique_lock.owns_lock" title="bool owns_lock() const"><code class="computeroutput"><span class="identifier">owns_lock</span><span class="special">()</span></code></a> - returns <code class="computeroutput"><span class="keyword">true</span></code>, otherwise - <a class="link" href="synchronization.html#thread.synchronization.locks.unique_lock.owns_lock" title="bool owns_lock() const"><code class="computeroutput"><span class="identifier">owns_lock</span><span class="special">()</span></code></a> - returns <code class="computeroutput"><span class="keyword">false</span></code>.
- </p></dd> -<dt><span class="term">Throws:</span></dt> -<dd><p>- Any exceptions thrown by the call to <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.timed_lockable.timed_lock" title="bool timed_lock(boost::system_time const& abs_time)"><code class="computeroutput"><span class="identifier">m</span><span class="special">.</span><span class="identifier">timed_lock</span><span class="special">(</span><span class="identifier">abs_time</span><span class="special">)</span></code></a>.
- </p></dd> -</dl> -</div> -</div> -<div class="section" lang="en"> -<div class="titlepage"><div><div><h5 class="title">-<a name="thread.synchronization.locks.unique_lock.destructor"></a><a class="link" href="synchronization.html#thread.synchronization.locks.unique_lock.destructor" title="~unique_lock()"> - <code class="computeroutput"><span class="special">~</span><span class="identifier">unique_lock</span><span class="special">()</span></code></a>
-</h5></div></div></div> -<div class="variablelist"> -<p class="title"><b></b></p> -<dl> -<dt><span class="term">Effects:</span></dt> -<dd><p>- Invokes <a class="link" href="synchronization.html#thread.synchronization.locks.unique_lock.mutex" title="Lockable* mutex() const"><code class="computeroutput"><span class="identifier">mutex</span><span class="special">()</span></code></a><code class="computeroutput"><span class="special">-></span></code> <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable.unlock" title="void unlock()"><code class="computeroutput"><span class="identifier">unlock</span><span class="special">()</span></code></a> - if <a class="link" href="synchronization.html#thread.synchronization.locks.unique_lock.owns_lock" title="bool owns_lock() const"><code class="computeroutput"><span class="identifier">owns_lock</span><span class="special">()</span></code></a> - returns <code class="computeroutput"><span class="keyword">true</span></code>.
- </p></dd> -<dt><span class="term">Throws:</span></dt> -<dd><p> - Nothing. - </p></dd> -</dl> -</div> -</div> -<div class="section" lang="en"> -<div class="titlepage"><div><div><h5 class="title">-<a name="thread.synchronization.locks.unique_lock.owns_lock"></a><a class="link" href="synchronization.html#thread.synchronization.locks.unique_lock.owns_lock" title="bool owns_lock() const"> - <code class="computeroutput"><span class="keyword">bool</span> <span class="identifier">owns_lock</span><span class="special">()</span> <span class="keyword">const</span></code></a>
-</h5></div></div></div> -<div class="variablelist"> -<p class="title"><b></b></p> -<dl> -<dt><span class="term">Returns:</span></dt> -<dd><p>- <code class="computeroutput"><span class="keyword">true</span></code> if the <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code> - owns the lock on the <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable" title="Lockable Concept"><code class="computeroutput"><span class="identifier">Lockable</span></code></a> object associated - with <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
- </p></dd> -<dt><span class="term">Throws:</span></dt> -<dd><p> - Nothing. - </p></dd> -</dl> -</div> -</div> -<div class="section" lang="en"> -<div class="titlepage"><div><div><h5 class="title">-<a name="thread.synchronization.locks.unique_lock.mutex"></a><a class="link" href="synchronization.html#thread.synchronization.locks.unique_lock.mutex" title="Lockable* mutex() const"> - <code class="computeroutput"><span class="identifier">Lockable</span><span class="special">*</span> - <span class="identifier">mutex</span><span class="special">()</span>
- <span class="keyword">const</span></code></a> -</h5></div></div></div> -<div class="variablelist"> -<p class="title"><b></b></p> -<dl> -<dt><span class="term">Returns:</span></dt> -<dd><p>- A pointer to the <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable" title="Lockable Concept"><code class="computeroutput"><span class="identifier">Lockable</span></code></a> object associated - with <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>, - or <code class="computeroutput"><span class="identifier">NULL</span></code> if there
- is no such object. - </p></dd> -<dt><span class="term">Throws:</span></dt> -<dd><p> - Nothing. - </p></dd> -</dl> -</div> -</div> -<div class="section" lang="en"> -<div class="titlepage"><div><div><h5 class="title">-<a name="thread.synchronization.locks.unique_lock.bool_conversion"></a><a class="link" href="synchronization.html#thread.synchronization.locks.unique_lock.bool_conversion" title="operator unspecified-bool-type() const"> - <code class="computeroutput"><span class="keyword">operator</span> <span class="identifier">unspecified</span><span class="special">-</span><span class="keyword">bool</span><span class="special">-</span><span class="identifier">type</span><span class="special">()</span> <span class="keyword">const</span></code></a>
-</h5></div></div></div> -<div class="variablelist"> -<p class="title"><b></b></p> -<dl> -<dt><span class="term">Returns:</span></dt> -<dd><p>- If <a class="link" href="synchronization.html#thread.synchronization.locks.unique_lock.owns_lock" title="bool owns_lock() const"><code class="computeroutput"><span class="identifier">owns_lock</span><span class="special">()</span></code></a> - would return <code class="computeroutput"><span class="keyword">true</span></code>, a - value that evaluates to <code class="computeroutput"><span class="keyword">true</span></code> - in boolean contexts, otherwise a value that evaluates to <code class="computeroutput"><span class="keyword">false</span></code> in boolean contexts.
- </p></dd> -<dt><span class="term">Throws:</span></dt> -<dd><p> - Nothing. - </p></dd> -</dl> -</div> -</div> -<div class="section" lang="en"> -<div class="titlepage"><div><div><h5 class="title">-<a name="thread.synchronization.locks.unique_lock.operator_not"></a><a class="link" href="synchronization.html#thread.synchronization.locks.unique_lock.operator_not" title="bool operator!() const"> - <code class="computeroutput"><span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">!()</span> <span class="keyword">const</span></code></a>
-</h5></div></div></div> -<div class="variablelist"> -<p class="title"><b></b></p> -<dl> -<dt><span class="term">Returns:</span></dt> -<dd><p>- <code class="computeroutput"><span class="special">!</span></code> <a class="link" href="synchronization.html#thread.synchronization.locks.unique_lock.owns_lock" title="bool owns_lock() const"><code class="computeroutput"><span class="identifier">owns_lock</span><span class="special">()</span></code></a>.
- </p></dd> -<dt><span class="term">Throws:</span></dt> -<dd><p> - Nothing. - </p></dd> -</dl> -</div> -</div> -<div class="section" lang="en"> -<div class="titlepage"><div><div><h5 class="title">-<a name="thread.synchronization.locks.unique_lock.release"></a><a class="link" href="synchronization.html#thread.synchronization.locks.unique_lock.release" title="Lockable* release()"> - <code class="computeroutput"><span class="identifier">Lockable</span><span class="special">*</span> - <span class="identifier">release</span><span class="special">()</span></code></a>
-</h5></div></div></div> -<div class="variablelist"> -<p class="title"><b></b></p> -<dl> -<dt><span class="term">Effects:</span></dt> -<dd><p>- The association between <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code> and the <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable" title="Lockable Concept"><code class="computeroutput"><span class="identifier">Lockable</span></code></a> object is removed, - without affecting the lock state of the <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable" title="Lockable Concept"><code class="computeroutput"><span class="identifier">Lockable</span></code></a> object. If <a class="link" href="synchronization.html#thread.synchronization.locks.unique_lock.owns_lock" title="bool owns_lock() const"><code class="computeroutput"><span class="identifier">owns_lock</span><span class="special">()</span></code></a> - would have returned <code class="computeroutput"><span class="keyword">true</span></code>, - it is the responsibility of the calling code to ensure that the - <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable" title="Lockable Concept"><code class="computeroutput"><span class="identifier">Lockable</span></code></a> is correctly unlocked.
- </p></dd> -<dt><span class="term">Returns:</span></dt> -<dd><p>- A pointer to the <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable" title="Lockable Concept"><code class="computeroutput"><span class="identifier">Lockable</span></code></a> object associated - with <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code> - at the point of the call, or <code class="computeroutput"><span class="identifier">NULL</span></code>
- if there is no such object. - </p></dd> -<dt><span class="term">Throws:</span></dt> -<dd><p> - Nothing. - </p></dd> -<dt><span class="term">Postcondition:</span></dt> -<dd><p>- <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code> - is no longer associated with any <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable" title="Lockable Concept"><code class="computeroutput"><span class="identifier">Lockable</span></code></a> object. <a class="link" href="synchronization.html#thread.synchronization.locks.unique_lock.mutex" title="Lockable* mutex() const"><code class="computeroutput"><span class="identifier">mutex</span><span class="special">()</span></code></a> - returns <code class="computeroutput"><span class="identifier">NULL</span></code> and - <a class="link" href="synchronization.html#thread.synchronization.locks.unique_lock.owns_lock" title="bool owns_lock() const"><code class="computeroutput"><span class="identifier">owns_lock</span><span class="special">()</span></code></a> - returns <code class="computeroutput"><span class="keyword">false</span></code>.
- </p></dd> -</dl> -</div> -</div> -</div> -<div class="section" lang="en"> -<div class="titlepage"><div><div><h4 class="title">-<a name="thread.synchronization.locks.shared_lock"></a><a class="link" href="synchronization.html#thread.synchronization.locks.shared_lock" title="Class template shared_lock"> Class template - <code class="computeroutput"><span class="identifier">shared_lock</span></code></a>
-</h4></div></div></div> -<div class="toc"><dl>-<dt><span class="section"><a href="synchronization.html#thread.synchronization.locks.shared_lock.defaultconstructor"> - <code class="computeroutput"><span class="identifier">shared_lock</span><span class="special">()</span></code></a></span></dt> -<dt><span class="section"><a href="synchronization.html#thread.synchronization.locks.shared_lock.constructor"> - <code class="computeroutput"><span class="identifier">shared_lock</span><span class="special">(</span><span class="identifier">Lockable</span> <span class="special">&</span> - <span class="identifier">m</span><span class="special">)</span></code></a></span></dt> -<dt><span class="section"><a href="synchronization.html#thread.synchronization.locks.shared_lock.constructor_adopt"> - <code class="computeroutput"><span class="identifier">shared_lock</span><span class="special">(</span><span class="identifier">Lockable</span> <span class="special">&</span> - <span class="identifier">m</span><span class="special">,</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">adopt_lock_t</span><span class="special">)</span></code></a></span></dt> -<dt><span class="section"><a href="synchronization.html#thread.synchronization.locks.shared_lock.constructor_defer"> - <code class="computeroutput"><span class="identifier">shared_lock</span><span class="special">(</span><span class="identifier">Lockable</span> <span class="special">&</span> - <span class="identifier">m</span><span class="special">,</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">defer_lock_t</span><span class="special">)</span></code></a></span></dt> -<dt><span class="section"><a href="synchronization.html#thread.synchronization.locks.shared_lock.constructor_try"> - <code class="computeroutput"><span class="identifier">shared_lock</span><span class="special">(</span><span class="identifier">Lockable</span> <span class="special">&</span> - <span class="identifier">m</span><span class="special">,</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">try_to_lock_t</span><span class="special">)</span></code></a></span></dt> -<dt><span class="section"><a href="synchronization.html#thread.synchronization.locks.shared_lock.constructor_abs_time"> - <code class="computeroutput"><span class="identifier">shared_lock</span><span class="special">(</span><span class="identifier">Lockable</span> <span class="special">&</span> - <span class="identifier">m</span><span class="special">,</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">system_time</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">abs_time</span><span class="special">)</span></code></a></span></dt> -<dt><span class="section"><a href="synchronization.html#thread.synchronization.locks.shared_lock.destructor"> - <code class="computeroutput"><span class="special">~</span><span class="identifier">shared_lock</span><span class="special">()</span></code></a></span></dt> -<dt><span class="section"><a href="synchronization.html#thread.synchronization.locks.shared_lock.owns_lock"> - <code class="computeroutput"><span class="keyword">bool</span> <span class="identifier">owns_lock</span><span class="special">()</span> <span class="keyword">const</span></code></a></span></dt> -<dt><span class="section"><a href="synchronization.html#thread.synchronization.locks.shared_lock.mutex"> - <code class="computeroutput"><span class="identifier">Lockable</span><span class="special">*</span> - <span class="identifier">mutex</span><span class="special">()</span>
- <span class="keyword">const</span></code></a></span></dt>-<dt><span class="section"><a href="synchronization.html#thread.synchronization.locks.shared_lock.bool_conversion"> - <code class="computeroutput"><span class="keyword">operator</span> <span class="identifier">unspecified</span><span class="special">-</span><span class="keyword">bool</span><span class="special">-</span><span class="identifier">type</span><span class="special">()</span> <span class="keyword">const</span></code></a></span></dt> -<dt><span class="section"><a href="synchronization.html#thread.synchronization.locks.shared_lock.operator_not"> - <code class="computeroutput"><span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">!()</span> <span class="keyword">const</span></code></a></span></dt> -<dt><span class="section"><a href="synchronization.html#thread.synchronization.locks.shared_lock.release"> - <code class="computeroutput"><span class="identifier">Lockable</span><span class="special">*</span> - <span class="identifier">release</span><span class="special">()</span></code></a></span></dt>
-</dl></div>-<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">thread</span><span class="special">/</span><span class="identifier">locks</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
--<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Lockable</span><span class="special">></span> -<span class="keyword">class</span> <span class="identifier">shared_lock</span>
-<span class="special">{</span> -<span class="keyword">public</span><span class="special">:</span>- <span class="identifier">shared_lock</span><span class="special">();</span> - <span class="keyword">explicit</span> <span class="identifier">shared_lock</span><span class="special">(</span><span class="identifier">Lockable</span><span class="special">&</span> <span class="identifier">m_</span><span class="special">);</span> - <span class="identifier">shared_lock</span><span class="special">(</span><span class="identifier">Lockable</span><span class="special">&</span> <span class="identifier">m_</span><span class="special">,</span><span class="identifier">adopt_lock_t</span><span class="special">);</span> - <span class="identifier">shared_lock</span><span class="special">(</span><span class="identifier">Lockable</span><span class="special">&</span> <span class="identifier">m_</span><span class="special">,</span><span class="identifier">defer_lock_t</span><span class="special">);</span> - <span class="identifier">shared_lock</span><span class="special">(</span><span class="identifier">Lockable</span><span class="special">&</span> <span class="identifier">m_</span><span class="special">,</span><span class="identifier">try_to_lock_t</span><span class="special">);</span> - <span class="identifier">shared_lock</span><span class="special">(</span><span class="identifier">Lockable</span><span class="special">&</span> <span class="identifier">m_</span><span class="special">,</span><span class="identifier">system_time</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">target_time</span><span class="special">);</span> - <span class="identifier">shared_lock</span><span class="special">(</span><span class="identifier">detail</span><span class="special">::</span><span class="identifier">thread_move_t</span><span class="special"><</span><span class="identifier">shared_lock</span><span class="special"><</span><span class="identifier">Lockable</span><span class="special">></span> <span class="special">></span> <span class="identifier">other</span><span class="special">);</span> - <span class="identifier">shared_lock</span><span class="special">(</span><span class="identifier">detail</span><span class="special">::</span><span class="identifier">thread_move_t</span><span class="special"><</span><span class="identifier">unique_lock</span><span class="special"><</span><span class="identifier">Lockable</span><span class="special">></span> <span class="special">></span> <span class="identifier">other</span><span class="special">);</span> - <span class="identifier">shared_lock</span><span class="special">(</span><span class="identifier">detail</span><span class="special">::</span><span class="identifier">thread_move_t</span><span class="special"><</span><span class="identifier">upgrade_lock</span><span class="special"><</span><span class="identifier">Lockable</span><span class="special">></span> <span class="special">></span> <span class="identifier">other</span><span class="special">);</span>
-- <span class="special">~</span><span class="identifier">shared_lock</span><span class="special">();</span>
-- <span class="keyword">operator</span> <span class="identifier">detail</span><span class="special">::</span><span class="identifier">thread_move_t</span><span class="special"><</span><span class="identifier">shared_lock</span><span class="special"><</span><span class="identifier">Lockable</span><span class="special">></span> <span class="special">>();</span> - <span class="identifier">detail</span><span class="special">::</span><span class="identifier">thread_move_t</span><span class="special"><</span><span class="identifier">shared_lock</span><span class="special"><</span><span class="identifier">Lockable</span><span class="special">></span> <span class="special">></span> <span class="identifier">move</span><span class="special">();</span>
-- <span class="identifier">shared_lock</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">=(</span><span class="identifier">detail</span><span class="special">::</span><span class="identifier">thread_move_t</span><span class="special"><</span><span class="identifier">shared_lock</span><span class="special"><</span><span class="identifier">Lockable</span><span class="special">></span> <span class="special">></span> <span class="identifier">other</span><span class="special">);</span> - <span class="identifier">shared_lock</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">=(</span><span class="identifier">detail</span><span class="special">::</span><span class="identifier">thread_move_t</span><span class="special"><</span><span class="identifier">unique_lock</span><span class="special"><</span><span class="identifier">Lockable</span><span class="special">></span> <span class="special">></span> <span class="identifier">other</span><span class="special">);</span> - <span class="identifier">shared_lock</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">=(</span><span class="identifier">detail</span><span class="special">::</span><span class="identifier">thread_move_t</span><span class="special"><</span><span class="identifier">upgrade_lock</span><span class="special"><</span><span class="identifier">Lockable</span><span class="special">></span> <span class="special">></span> <span class="identifier">other</span><span class="special">);</span> - <span class="keyword">void</span> <span class="identifier">swap</span><span class="special">(</span><span class="identifier">shared_lock</span><span class="special">&</span> <span class="identifier">other</span><span class="special">);</span>
-- <span class="keyword">void</span> <span class="identifier">lock</span><span class="special">();</span> - <span class="keyword">bool</span> <span class="identifier">try_lock</span><span class="special">();</span> - <span class="keyword">bool</span> <span class="identifier">timed_lock</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">system_time</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">target_time</span><span class="special">);</span> - <span class="keyword">void</span> <span class="identifier">unlock</span><span class="special">();</span>
-- <span class="keyword">operator</span> <span class="emphasis"><em>unspecified-bool-type</em></span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span> - <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">!()</span> <span class="keyword">const</span><span class="special">;</span> - <span class="keyword">bool</span> <span class="identifier">owns_lock</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
-<span class="special">};</span> -</pre> -<p>- Like <a class="link" href="synchronization.html#thread.synchronization.locks.unique_lock" title="Class template unique_lock"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">unique_lock</span></code></a>, <a class="link" href="synchronization.html#thread.synchronization.locks.shared_lock" title="Class template shared_lock"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">shared_lock</span></code></a> models the <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable" title="Lockable Concept"><code class="computeroutput"><span class="identifier">Lockable</span></code> concept</a>, but rather than - acquiring unique ownership of the supplied <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable" title="Lockable Concept"><code class="computeroutput"><span class="identifier">Lockable</span></code></a> object, locking an instance - of <a class="link" href="synchronization.html#thread.synchronization.locks.shared_lock" title="Class template shared_lock"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">shared_lock</span></code></a> acquires shared ownership.
- </p> -<p>- Like <a class="link" href="synchronization.html#thread.synchronization.locks.unique_lock" title="Class template unique_lock"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">unique_lock</span></code></a>, not only does it - provide for RAII-style locking, it also allows for deferring acquiring - the lock until the <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable.lock" title="void lock()"><code class="computeroutput"><span class="identifier">lock</span><span class="special">()</span></code></a> - member function is called explicitly, or trying to acquire the lock in - a non-blocking fashion, or with a timeout. Consequently, <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable.unlock" title="void unlock()"><code class="computeroutput"><span class="identifier">unlock</span><span class="special">()</span></code></a> - is only called in the destructor if the lock object has locked the <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable" title="Lockable Concept"><code class="computeroutput"><span class="identifier">Lockable</span></code></a> object, or otherwise - adopted a lock on the <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable" title="Lockable Concept"><code class="computeroutput"><span class="identifier">Lockable</span></code></a> object.
- </p> -<p>- An instance of <a class="link" href="synchronization.html#thread.synchronization.locks.shared_lock" title="Class template shared_lock"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">shared_lock</span></code></a> is said to <span class="emphasis"><em>own</em></span> - the lock state of a <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable" title="Lockable Concept"><code class="computeroutput"><span class="identifier">Lockable</span></code></a> <code class="computeroutput"><span class="identifier">m</span></code> - if <a class="link" href="synchronization.html#thread.synchronization.locks.unique_lock.mutex" title="Lockable* mutex() const"><code class="computeroutput"><span class="identifier">mutex</span><span class="special">()</span></code></a> - returns a pointer to <code class="computeroutput"><span class="identifier">m</span></code> - and <a class="link" href="synchronization.html#thread.synchronization.locks.unique_lock.owns_lock" title="bool owns_lock() const"><code class="computeroutput"><span class="identifier">owns_lock</span><span class="special">()</span></code></a> - returns <code class="computeroutput"><span class="keyword">true</span></code>. If an object - that <span class="emphasis"><em>owns</em></span> the lock state of a <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable" title="Lockable Concept"><code class="computeroutput"><span class="identifier">Lockable</span></code></a> object is destroyed, - then the destructor will invoke <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.shared_lockable.unlock_shared" title="void unlock_shared()"><code class="computeroutput"><span class="identifier">mutex</span><span class="special">()-></span><span class="identifier">unlock_shared</span><span class="special">()</span></code></a>.
- </p> -<p>- The member functions of <a class="link" href="synchronization.html#thread.synchronization.locks.shared_lock" title="Class template shared_lock"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">shared_lock</span></code></a> are not thread-safe. - In particular, <a class="link" href="synchronization.html#thread.synchronization.locks.shared_lock" title="Class template shared_lock"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">shared_lock</span></code></a> is intended to model - the shared ownership of a <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.lockable" title="Lockable Concept"><code class="computeroutput"><span class="identifier">Lockable</span></code></a> object by a particular - thread, and the member functions that release ownership of the lock state - (including the destructor) must be called by the same thread that acquired
- ownership of the lock state. - </p> -<div class="section" lang="en"> -<div class="titlepage"><div><div><h5 class="title">-<a name="thread.synchronization.locks.shared_lock.defaultconstructor"></a><a class="link" href="synchronization.html#thread.synchronization.locks.shared_lock.defaultconstructor" title="shared_lock()"> - <code class="computeroutput"><span class="identifier">shared_lock</span><span class="special">()</span></code></a>
-</h5></div></div></div> -<div class="variablelist"> -<p class="title"><b></b></p> -<dl> -<dt><span class="term">Effects:</span></dt> -<dd><p> - Creates a lock object with no associated mutex. - </p></dd> -<dt><span class="term">Postcondition:</span></dt> -<dd><p>- <a class="link" href="synchronization.html#thread.synchronization.locks.unique_lock.owns_lock" title="bool owns_lock() const"><code class="computeroutput"><span class="identifier">owns_lock</span><span class="special">()</span></code></a> - returns <code class="computeroutput"><span class="keyword">false</span></code>. <a class="link" href="synchronization.html#thread.synchronization.locks.unique_lock.mutex" title="Lockable* mutex() const"><code class="computeroutput"><span class="identifier">mutex</span><span class="special">()</span></code></a> - returns <code class="computeroutput"><span class="identifier">NULL</span></code>.
- </p></dd> -<dt><span class="term">Throws:</span></dt> -<dd><p> - Nothing. - </p></dd> -</dl> -</div> -</div> -<div class="section" lang="en"> -<div class="titlepage"><div><div><h5 class="title">-<a name="thread.synchronization.locks.shared_lock.constructor"></a><a class="link" href="synchronization.html#thread.synchronization.locks.shared_lock.constructor" title="shared_lock(Lockable & m)"> - <code class="computeroutput"><span class="identifier">shared_lock</span><span class="special">(</span><span class="identifier">Lockable</span> <span class="special">&</span> - <span class="identifier">m</span><span class="special">)</span></code></a>
-</h5></div></div></div> -<div class="variablelist"> -<p class="title"><b></b></p> -<dl> -<dt><span class="term">Effects:</span></dt> -<dd><p>- Stores a reference to <code class="computeroutput"><span class="identifier">m</span></code>. - Invokes <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.shared_lockable.lock_shared" title="void lock_shared()"><code class="computeroutput"><span class="identifier">m</span><span class="special">.</span><span class="identifier">lock_shared</span><span class="special">()</span></code></a>.
- </p></dd> -<dt><span class="term">Postcondition:</span></dt> -<dd><p>- <a class="link" href="synchronization.html#thread.synchronization.locks.shared_lock.owns_lock" title="bool owns_lock() const"><code class="computeroutput"><span class="identifier">owns_lock</span><span class="special">()</span></code></a> - returns <code class="computeroutput"><span class="keyword">true</span></code>. <a class="link" href="synchronization.html#thread.synchronization.locks.unique_lock.mutex" title="Lockable* mutex() const"><code class="computeroutput"><span class="identifier">mutex</span><span class="special">()</span></code></a> - returns <code class="computeroutput"><span class="special">&</span><span class="identifier">m</span></code>.
- </p></dd> -<dt><span class="term">Throws:</span></dt> -<dd><p>- Any exception thrown by the call to <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.shared_lockable.lock_shared" title="void lock_shared()"><code class="computeroutput"><span class="identifier">m</span><span class="special">.</span><span class="identifier">lock_shared</span><span class="special">()</span></code></a>.
- </p></dd> -</dl> -</div> -</div> -<div class="section" lang="en"> -<div class="titlepage"><div><div><h5 class="title">-<a name="thread.synchronization.locks.shared_lock.constructor_adopt"></a><a class="link" href="synchronization.html#thread.synchronization.locks.shared_lock.constructor_adopt" title="shared_lock(Lockable & m,boost::adopt_lock_t)"> - <code class="computeroutput"><span class="identifier">shared_lock</span><span class="special">(</span><span class="identifier">Lockable</span> <span class="special">&</span> - <span class="identifier">m</span><span class="special">,</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">adopt_lock_t</span><span class="special">)</span></code></a>
-</h5></div></div></div> -<div class="variablelist"> -<p class="title"><b></b></p> -<dl> -<dt><span class="term">Precondition:</span></dt> -<dd><p>- The current thread owns an exclusive lock on <code class="computeroutput"><span class="identifier">m</span></code>.
- </p></dd> -<dt><span class="term">Effects:</span></dt> -<dd><p>- Stores a reference to <code class="computeroutput"><span class="identifier">m</span></code>. - Takes ownership of the lock state of <code class="computeroutput"><span class="identifier">m</span></code>.
- </p></dd> -<dt><span class="term">Postcondition:</span></dt> -<dd><p>- <a class="link" href="synchronization.html#thread.synchronization.locks.shared_lock.owns_lock" title="bool owns_lock() const"><code class="computeroutput"><span class="identifier">owns_lock</span><span class="special">()</span></code></a> - returns <code class="computeroutput"><span class="keyword">true</span></code>. <a class="link" href="synchronization.html#thread.synchronization.locks.unique_lock.mutex" title="Lockable* mutex() const"><code class="computeroutput"><span class="identifier">mutex</span><span class="special">()</span></code></a> - returns <code class="computeroutput"><span class="special">&</span><span class="identifier">m</span></code>.
- </p></dd> -<dt><span class="term">Throws:</span></dt> -<dd><p> - Nothing. - </p></dd> -</dl> -</div> -</div> -<div class="section" lang="en"> -<div class="titlepage"><div><div><h5 class="title">-<a name="thread.synchronization.locks.shared_lock.constructor_defer"></a><a class="link" href="synchronization.html#thread.synchronization.locks.shared_lock.constructor_defer" title="shared_lock(Lockable & m,boost::defer_lock_t)"> - <code class="computeroutput"><span class="identifier">shared_lock</span><span class="special">(</span><span class="identifier">Lockable</span> <span class="special">&</span> - <span class="identifier">m</span><span class="special">,</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">defer_lock_t</span><span class="special">)</span></code></a>
-</h5></div></div></div> -<div class="variablelist"> -<p class="title"><b></b></p> -<dl> -<dt><span class="term">Effects:</span></dt> -<dd><p>- Stores a reference to <code class="computeroutput"><span class="identifier">m</span></code>.
- </p></dd> -<dt><span class="term">Postcondition:</span></dt> -<dd><p>- <a class="link" href="synchronization.html#thread.synchronization.locks.shared_lock.owns_lock" title="bool owns_lock() const"><code class="computeroutput"><span class="identifier">owns_lock</span><span class="special">()</span></code></a> - returns <code class="computeroutput"><span class="keyword">false</span></code>. <a class="link" href="synchronization.html#thread.synchronization.locks.unique_lock.mutex" title="Lockable* mutex() const"><code class="computeroutput"><span class="identifier">mutex</span><span class="special">()</span></code></a> - returns <code class="computeroutput"><span class="special">&</span><span class="identifier">m</span></code>.
- </p></dd> -<dt><span class="term">Throws:</span></dt> -<dd><p> - Nothing. - </p></dd> -</dl> -</div> -</div> -<div class="section" lang="en"> -<div class="titlepage"><div><div><h5 class="title">-<a name="thread.synchronization.locks.shared_lock.constructor_try"></a><a class="link" href="synchronization.html#thread.synchronization.locks.shared_lock.constructor_try" title="shared_lock(Lockable & m,boost::try_to_lock_t)"> - <code class="computeroutput"><span class="identifier">shared_lock</span><span class="special">(</span><span class="identifier">Lockable</span> <span class="special">&</span> - <span class="identifier">m</span><span class="special">,</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">try_to_lock_t</span><span class="special">)</span></code></a>
-</h5></div></div></div> -<div class="variablelist"> -<p class="title"><b></b></p> -<dl> -<dt><span class="term">Effects:</span></dt> -<dd><p>- Stores a reference to <code class="computeroutput"><span class="identifier">m</span></code>. - Invokes <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.shared_lockable.try_lock_shared" title="bool try_lock_shared()"><code class="computeroutput"><span class="identifier">m</span><span class="special">.</span><span class="identifier">try_lock_shared</span><span class="special">()</span></code></a>, - and takes ownership of the lock state if the call returns <code class="computeroutput"><span class="keyword">true</span></code>.
- </p></dd> -<dt><span class="term">Postcondition:</span></dt> -<dd><p>- <a class="link" href="synchronization.html#thread.synchronization.locks.unique_lock.mutex" title="Lockable* mutex() const"><code class="computeroutput"><span class="identifier">mutex</span><span class="special">()</span></code></a> - returns <code class="computeroutput"><span class="special">&</span><span class="identifier">m</span></code>. - If the call to <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.shared_lockable.try_lock_shared" title="bool try_lock_shared()"><code class="computeroutput"><span class="identifier">try_lock_shared</span><span class="special">()</span></code></a> - returned <code class="computeroutput"><span class="keyword">true</span></code>, then - <a class="link" href="synchronization.html#thread.synchronization.locks.shared_lock.owns_lock" title="bool owns_lock() const"><code class="computeroutput"><span class="identifier">owns_lock</span><span class="special">()</span></code></a> - returns <code class="computeroutput"><span class="keyword">true</span></code>, otherwise - <a class="link" href="synchronization.html#thread.synchronization.locks.shared_lock.owns_lock" title="bool owns_lock() const"><code class="computeroutput"><span class="identifier">owns_lock</span><span class="special">()</span></code></a> - returns <code class="computeroutput"><span class="keyword">false</span></code>.
- </p></dd> -<dt><span class="term">Throws:</span></dt> -<dd><p> - Nothing. - </p></dd> -</dl> -</div> -</div> -<div class="section" lang="en"> -<div class="titlepage"><div><div><h5 class="title">-<a name="thread.synchronization.locks.shared_lock.constructor_abs_time"></a><a class="link" href="synchronization.html#thread.synchronization.locks.shared_lock.constructor_abs_time" title="shared_lock(Lockable & m,boost::system_time const& abs_time)"> - <code class="computeroutput"><span class="identifier">shared_lock</span><span class="special">(</span><span class="identifier">Lockable</span> <span class="special">&</span> - <span class="identifier">m</span><span class="special">,</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">system_time</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">abs_time</span><span class="special">)</span></code></a>
-</h5></div></div></div> -<div class="variablelist"> -<p class="title"><b></b></p> -<dl> -<dt><span class="term">Effects:</span></dt> -<dd><p>- Stores a reference to <code class="computeroutput"><span class="identifier">m</span></code>. - Invokes <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.shared_lockable.timed_lock_shared" title="bool timed_lock_shared(boost::system_time const& abs_time)"><code class="computeroutput"><span class="identifier">m</span><span class="special">.</span><span class="identifier">timed_lock</span><span class="special">(</span><span class="identifier">abs_time</span><span class="special">)</span></code></a>, - and takes ownership of the lock state if the call returns <code class="computeroutput"><span class="keyword">true</span></code>.
- </p></dd> -<dt><span class="term">Postcondition:</span></dt> -<dd><p>- <a class="link" href="synchronization.html#thread.synchronization.locks.unique_lock.mutex" title="Lockable* mutex() const"><code class="computeroutput"><span class="identifier">mutex</span><span class="special">()</span></code></a> - returns <code class="computeroutput"><span class="special">&</span><span class="identifier">m</span></code>. - If the call to <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.shared_lockable.timed_lock_shared" title="bool timed_lock_shared(boost::system_time const& abs_time)"><code class="computeroutput"><span class="identifier">timed_lock_shared</span><span class="special">()</span></code></a> - returned <code class="computeroutput"><span class="keyword">true</span></code>, then - <a class="link" href="synchronization.html#thread.synchronization.locks.shared_lock.owns_lock" title="bool owns_lock() const"><code class="computeroutput"><span class="identifier">owns_lock</span><span class="special">()</span></code></a> - returns <code class="computeroutput"><span class="keyword">true</span></code>, otherwise - <a class="link" href="synchronization.html#thread.synchronization.locks.shared_lock.owns_lock" title="bool owns_lock() const"><code class="computeroutput"><span class="identifier">owns_lock</span><span class="special">()</span></code></a> - returns <code class="computeroutput"><span class="keyword">false</span></code>.
- </p></dd> -<dt><span class="term">Throws:</span></dt> -<dd><p>- Any exceptions thrown by the call to <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.shared_lockable.timed_lock_shared" title="bool timed_lock_shared(boost::system_time const& abs_time)"><code class="computeroutput"><span class="identifier">m</span><span class="special">.</span><span class="identifier">timed_lock</span><span class="special">(</span><span class="identifier">abs_time</span><span class="special">)</span></code></a>.
- </p></dd> -</dl> -</div> -</div> -<div class="section" lang="en"> -<div class="titlepage"><div><div><h5 class="title"> -<a name="thread.synchronization.locks.shared_lock.destr ============================================================================== Diff truncated at 200k characters