<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Using and building the library</title>
<link rel="stylesheet" href="../../../doc/src/boostbook.css" type="text/css">
-<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
-<link rel="up" href="../thread.html" title="Chapter 28. Thread 3.0.1">
-<link rel="prev" href="../thread.html" title="Chapter 28. Thread 3.0.1">
+<link rel="up" href="../thread.html" title="Chapter 30. Thread 4.4.0">
+<link rel="prev" href="../thread.html" title="Chapter 30. Thread 4.4.0">
<link rel="next" href="changes.html" title="History">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="thread.build"></a><a class="link" href="build.html" title="Using and building the library">Using and building the library</a>
</h2></div></div></div>
-<div class="toc"><dl>
+<div class="toc"><dl class="toc">
<dt><span class="section"><a href="build.html#thread.build.configuration">Configuration</a></span></dt>
<dt><span class="section"><a href="build.html#thread.build.limitations">Limitations</a></span></dt>
</dl></div>
any case.
</p>
<p>
+ Boost.Thread depends on some non header-only libraries.
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
+<li class="listitem">
+ Boost.System: This dependency is mandatory and you will need to link with
+ the library.
+ </li>
+<li class="listitem">
+ Boost.Chrono: This dependency is optional (see below how to configure)
+ and you will need to link with the library if you use some of the time
+ related interfaces.
+ </li>
+<li class="listitem">
+ Boost.DateTime: This dependency is mandatory, but even if Boost.DateTime
+ is a non header-only library Boost.Thread uses only parts that are header-only,
+ so in principle you should not need to link with the library.
+ </li>
+</ul></div>
+<p>
+ It seems that there are some IDE (as e.g. Visual Studio) that deduce the libraries
+ that a program needs to link to inspecting the sources. Such IDE could force
+ to link to Boost.DateTime and/or Boost.Chrono.
+ </p>
+<p>
+ As the single mandatory dependency is to Boost.System, the following
+ </p>
+<pre class="programlisting"><span class="identifier">bjam</span> <span class="identifier">toolset</span><span class="special">=</span><span class="identifier">msvc</span><span class="special">-</span><span class="number">11.0</span> <span class="special">--</span><span class="identifier">build</span><span class="special">-</span><span class="identifier">type</span><span class="special">=</span><span class="identifier">complete</span> <span class="special">--</span><span class="identifier">with</span><span class="special">-</span><span class="identifier">thread</span>
+</pre>
+<p>
+ will install only boost_thread and boost_system.
+ </p>
+<p>
+ Users of such IDE should force the Boost.Chrono and Boost.DateTime build using
+ </p>
+<pre class="programlisting"><span class="identifier">bjam</span> <span class="identifier">toolset</span><span class="special">=</span><span class="identifier">msvc</span><span class="special">-</span><span class="number">11.0</span> <span class="special">--</span><span class="identifier">build</span><span class="special">-</span><span class="identifier">type</span><span class="special">=</span><span class="identifier">complete</span> <span class="special">--</span><span class="identifier">with</span><span class="special">-</span><span class="identifier">thread</span> <span class="special">--</span><span class="identifier">with</span><span class="special">-</span><span class="identifier">chrono</span> <span class="special">--</span><span class="identifier">with</span><span class="special">-</span><span class="identifier">date_time</span>
+</pre>
+<p>
The following section describes all the macros used to configure Boost.Thread.
</p>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="thread.build.configuration"></a><a class="link" href="build.html#thread.build.configuration" title="Configuration">Configuration</a>
</h3></div></div></div>
-<div class="toc"><dl>
-<dt><span class="section"><a href="build.html#thread.build.configuration.system">Boost.System</a></span></dt>
+<div class="toc"><dl class="toc">
<dt><span class="section"><a href="build.html#thread.build.configuration.chrono">Boost.Chrono</a></span></dt>
<dt><span class="section"><a href="build.html#thread.build.configuration.move">Boost.Move</a></span></dt>
+<dt><span class="section"><a href="build.html#thread.build.configuration.date_time">Boost.DateTime</a></span></dt>
+<dt><span class="section"><a href="build.html#thread.build.configuration.move0">Boost.Atomic</a></span></dt>
+<dt><span class="section"><a href="build.html#thread.build.configuration.thread_eq"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span><span class="special">::</span><span class="keyword">operator</span><span class="special">==</span></code>
+ deprecated</a></span></dt>
+<dt><span class="section"><a href="build.html#thread.build.configuration.condition">boost::condition
+ deprecated</a></span></dt>
+<dt><span class="section"><a href="build.html#thread.build.configuration.nested_lock">Mutex nested
+ lock types deprecated</a></span></dt>
+<dt><span class="section"><a href="build.html#thread.build.configuration.id">thread::id</a></span></dt>
<dt><span class="section"><a href="build.html#thread.build.configuration.shared_gen">Shared Locking
Generic</a></span></dt>
<dt><span class="section"><a href="build.html#thread.build.configuration.shared_upwards">Shared Locking
<dt><span class="section"><a href="build.html#thread.build.configuration.terminate">Call to terminate
if joinable</a></span></dt>
<dt><span class="section"><a href="build.html#thread.build.configuration.once_flag">once_flag</a></span></dt>
-<dt><span class="section"><a href="build.html#thread.build.configuration.deprecated">Deprecated</a></span></dt>
+<dt><span class="section"><a href="build.html#thread.build.configuration.deprecated">Signature parameter
+ for packaged_task</a></span></dt>
+<dt><span class="section"><a href="build.html#thread.build.configuration.thread_const">-var thread
+ constructor with variadic rvalue parameters</a></span></dt>
+<dt><span class="section"><a href="build.html#thread.build.configuration.get_invalid">future<>::get()
+ invalidates the future</a></span></dt>
+<dt><span class="section"><a href="build.html#thread.build.configuration.intr">Interruptions</a></span></dt>
<dt><span class="section"><a href="build.html#thread.build.configuration.version">Version</a></span></dt>
</dl></div>
+<div class="table">
+<a name="thread.build.configuration.default_values_for_configurable_features"></a><p class="title"><b>Table 30.1. Default Values for Configurable Features</b></p>
+<div class="table-contents"><table class="table" summary="Default Values for Configurable Features">
+<colgroup>
+<col>
+<col>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Feature
+ </p>
+ </th>
+<th>
+ <p>
+ Anti-Feature
+ </p>
+ </th>
+<th>
+ <p>
+ V2
+ </p>
+ </th>
+<th>
+ <p>
+ V3
+ </p>
+ </th>
+<th>
+ <p>
+ V4
+ </p>
+ </th>
+</tr></thead>
+<tbody>
+<tr>
+<td>
+ <p>
+ USES_CHRONO
+ </p>
+ </td>
+<td>
+ <p>
+ DONT_USE_CHRONO
+ </p>
+ </td>
+<td>
+ <p>
+ YES/NO
+ </p>
+ </td>
+<td>
+ <p>
+ YES/NO
+ </p>
+ </td>
+<td>
+ <p>
+ YES/NO
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ PROVIDES_INTERRUPTIONS
+ </p>
+ </td>
+<td>
+ <p>
+ DONT_PROVIDE_INTERRUPTIONS
+ </p>
+ </td>
+<td>
+ <p>
+ YES
+ </p>
+ </td>
+<td>
+ <p>
+ YES
+ </p>
+ </td>
+<td>
+ <p>
+ YES
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ THROW_IF_PRECONDITION_NOT_SATISFIED
+ </p>
+ </td>
+<td>
+ <p>
+ -
+ </p>
+ </td>
+<td>
+ <p>
+ NO
+ </p>
+ </td>
+<td>
+ <p>
+ NO
+ </p>
+ </td>
+<td>
+ <p>
+ NO
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ PROVIDES_PROMISE_LAZY
+ </p>
+ </td>
+<td>
+ <p>
+ DONT_PROVIDE_PROMISE_LAZY
+ </p>
+ </td>
+<td>
+ <p>
+ YES
+ </p>
+ </td>
+<td>
+ <p>
+ NO
+ </p>
+ </td>
+<td>
+ <p>
+ NO
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ PROVIDES_BASIC_THREAD_ID
+ </p>
+ </td>
+<td>
+ <p>
+ DONT_PROVIDE_BASIC_THREAD_ID
+ </p>
+ </td>
+<td>
+ <p>
+ NO
+ </p>
+ </td>
+<td>
+ <p>
+ YES
+ </p>
+ </td>
+<td>
+ <p>
+ YES
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN
+ </p>
+ </td>
+<td>
+ <p>
+ DONT_PROVIDE_GENERIC_SHARED_MUTEX_ON_WIN
+ </p>
+ </td>
+<td>
+ <p>
+ NO
+ </p>
+ </td>
+<td>
+ <p>
+ YES
+ </p>
+ </td>
+<td>
+ <p>
+ YES
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSION
+ </p>
+ </td>
+<td>
+ <p>
+ DONT_PROVIDE_SHARED_MUTEX_UPWARDS_CONVERSION
+ </p>
+ </td>
+<td>
+ <p>
+ NO
+ </p>
+ </td>
+<td>
+ <p>
+ YES
+ </p>
+ </td>
+<td>
+ <p>
+ YES
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ PROVIDES_EXPLICIT_LOCK_CONVERSION
+ </p>
+ </td>
+<td>
+ <p>
+ DONT_PROVIDE_EXPLICIT_LOCK_CONVERSION
+ </p>
+ </td>
+<td>
+ <p>
+ NO
+ </p>
+ </td>
+<td>
+ <p>
+ YES
+ </p>
+ </td>
+<td>
+ <p>
+ YES
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ PROVIDES_FUTURE
+ </p>
+ </td>
+<td>
+ <p>
+ DONT_PROVIDE_FUTURE
+ </p>
+ </td>
+<td>
+ <p>
+ NO
+ </p>
+ </td>
+<td>
+ <p>
+ YES
+ </p>
+ </td>
+<td>
+ <p>
+ YES
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ PROVIDES_FUTURE_CTOR_ALLOCATORS
+ </p>
+ </td>
+<td>
+ <p>
+ DONT_PROVIDE_FUTURE_CTOR_ALLOCATORS
+ </p>
+ </td>
+<td>
+ <p>
+ NO
+ </p>
+ </td>
+<td>
+ <p>
+ YES
+ </p>
+ </td>
+<td>
+ <p>
+ YES
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ PROVIDES_THREAD_DESTRUCTOR_CALLS_TERMINATE_IF_JOINABLE
+ </p>
+ </td>
+<td>
+ <p>
+ DONT_PROVIDE_THREAD_DESTRUCTOR_CALLS_TERMINATE_IF_JOINABLE
+ </p>
+ </td>
+<td>
+ <p>
+ NO
+ </p>
+ </td>
+<td>
+ <p>
+ YES
+ </p>
+ </td>
+<td>
+ <p>
+ YES
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ PROVIDES_THREAD_MOVE_ASSIGN_CALLS_TERMINATE_IF_JOINABLE
+ </p>
+ </td>
+<td>
+ <p>
+ DONT_PROVIDE_THREAD_MOVE_ASSIGN_CALLS_TERMINATE_IF_JOINABLE
+ </p>
+ </td>
+<td>
+ <p>
+ NO
+ </p>
+ </td>
+<td>
+ <p>
+ YES
+ </p>
+ </td>
+<td>
+ <p>
+ YES
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ PROVIDES_ONCE_CXX11
+ </p>
+ </td>
+<td>
+ <p>
+ DONT_PROVIDE_ONCE_CXX11
+ </p>
+ </td>
+<td>
+ <p>
+ NO
+ </p>
+ </td>
+<td>
+ <p>
+ YES
+ </p>
+ </td>
+<td>
+ <p>
+ YES
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ USES_MOVE
+ </p>
+ </td>
+<td>
+ <p>
+ DONT_USE_MOVE
+ </p>
+ </td>
+<td>
+ <p>
+ NO
+ </p>
+ </td>
+<td>
+ <p>
+ YES
+ </p>
+ </td>
+<td>
+ <p>
+ YES
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ USES_DATETIME
+ </p>
+ </td>
+<td>
+ <p>
+ DONT_USE_DATETIME
+ </p>
+ </td>
+<td>
+ <p>
+ YES/NO
+ </p>
+ </td>
+<td>
+ <p>
+ YES/NO
+ </p>
+ </td>
+<td>
+ <p>
+ YES/NO
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ PROVIDES_THREAD_EQ
+ </p>
+ </td>
+<td>
+ <p>
+ DONT_PROVIDE_THREAD_EQ
+ </p>
+ </td>
+<td>
+ <p>
+ YES
+ </p>
+ </td>
+<td>
+ <p>
+ YES
+ </p>
+ </td>
+<td>
+ <p>
+ NO
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ PROVIDES_CONDITION
+ </p>
+ </td>
+<td>
+ <p>
+ DONT_PROVIDE_CONDITION
+ </p>
+ </td>
+<td>
+ <p>
+ YES
+ </p>
+ </td>
+<td>
+ <p>
+ YES
+ </p>
+ </td>
+<td>
+ <p>
+ NO
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ PROVIDES_NESTED_LOCKS
+ </p>
+ </td>
+<td>
+ <p>
+ DONT_PROVIDE_NESTED_LOCKS
+ </p>
+ </td>
+<td>
+ <p>
+ YES
+ </p>
+ </td>
+<td>
+ <p>
+ YES
+ </p>
+ </td>
+<td>
+ <p>
+ NO
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ PROVIDES_SIGNATURE_PACKAGED_TASK
+ </p>
+ </td>
+<td>
+ <p>
+ DONT_PROVIDE_SIGNATURE_PACKAGED_TASK
+ </p>
+ </td>
+<td>
+ <p>
+ NO
+ </p>
+ </td>
+<td>
+ <p>
+ NO
+ </p>
+ </td>
+<td>
+ <p>
+ YES
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ PROVIDES_FUTURE_INVALID_AFTER_GET
+ </p>
+ </td>
+<td>
+ <p>
+ DONT_PROVIDE_FUTURE_INVALID_AFTER_GET
+ </p>
+ </td>
+<td>
+ <p>
+ NO
+ </p>
+ </td>
+<td>
+ <p>
+ NO
+ </p>
+ </td>
+<td>
+ <p>
+ YES
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ PROVIDES_VARIADIC_THREAD
+ </p>
+ </td>
+<td>
+ <p>
+ DONT_PROVIDE_VARIADIC_THREAD
+ </p>
+ </td>
+<td>
+ <p>
+ NO
+ </p>
+ </td>
+<td>
+ <p>
+ NO
+ </p>
+ </td>
+<td>
+ <p>
+ C++11
+ </p>
+ </td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<br class="table-break"><div class="section">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="thread.build.configuration.chrono"></a><a class="link" href="build.html#thread.build.configuration.chrono" title="Boost.Chrono">Boost.Chrono</a>
+</h4></div></div></div>
+<p>
+ Boost.Thread uses by default Boost.Chrono for the time related functions
+ and define <code class="computeroutput"><span class="identifier">BOOST_THREAD_USES_CHRONO</span></code>
+ if <code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_USE_CHRONO</span></code>
+ is not defined. The user should define <code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_USE_CHRONO</span></code>
+ for compilers that don't work well with Boost.Chrono.
+ </p>
+<div class="warning"><table border="0" summary="Warning">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="../../../doc/src/images/warning.png"></td>
+<th align="left">Warning</th>
+</tr>
+<tr><td align="left" valign="top"><p>
+ When defined BOOST_THREAD_PLATFORM_WIN32 BOOST_THREAD_USES_CHRONO is
+ defined independently of user settings.
+ </p></td></tr>
+</table></div>
+</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
-<a name="thread.build.configuration.system"></a><a class="link" href="build.html#thread.build.configuration.system" title="Boost.System">Boost.System</a>
+<a name="thread.build.configuration.move"></a><a class="link" href="build.html#thread.build.configuration.move" title="Boost.Move">Boost.Move</a>
</h4></div></div></div>
<p>
- Boost.Thread uses by default Boost.System to define the exceptions. For
- backward compatibility and also for compilers that don't work well with
- Boost.System the user can define <code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_USE_SYSTEM</span>
- </code>.
+ Boost.Thread uses by default an internal move semantic implementation.
+ Since version 3.0.0 you can use the move emulation emulation provided by
+ Boost.Move.
</p>
<p>
- <code class="computeroutput"><span class="identifier">BOOST_THREAD_USES_SYSTEM</span></code>
- is defined when Boost.Thread uses Boost.Move.
+ When <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span><span class="special">==</span><span class="number">2</span></code> define
+ <code class="computeroutput"><span class="identifier">BOOST_THREAD_USES_MOVE</span> </code>
+ if you want to use Boost.Move interface. When <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span><span class="special">>=</span><span class="number">3</span></code> define
+ <code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_USE_MOVE</span> </code>
+ if you don't want to use Boost.Move interface.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
-<a name="thread.build.configuration.chrono"></a><a class="link" href="build.html#thread.build.configuration.chrono" title="Boost.Chrono">Boost.Chrono</a>
+<a name="thread.build.configuration.date_time"></a><a class="link" href="build.html#thread.build.configuration.date_time" title="Boost.DateTime">Boost.DateTime</a>
</h4></div></div></div>
<p>
- Boost.Thread uses by default Boost.Chrono for the time related functions.
- For backward compatibility and also for compilers that don't work well
- with Boost.Chrono the user can define <code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_USE_CHRONO</span></code>.
- If <code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_USE_SYSTEM</span></code>
- is defined then <code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_USE_CHRONO</span></code>
- is defined implicitly.
+ The Boost.DateTime time related functions introduced in Boost 1.35.0, using
+ the <a class="link" href="../date_time.html" title="Chapter 9. Boost.Date_Time">Boost.Date_Time</a> library are deprecated.
+ These include (but are not limited to):
</p>
+<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
+<li class="listitem">
+ <a class="link" href="thread_management.html#thread.thread_management.this_thread.sleep" title="Non-member function sleep() DEPRECATED"><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">sleep</span><span class="special">()</span></code></a>
+ </li>
+<li class="listitem">
+ <a class="link" href="thread_management.html#thread.thread_management.thread.timed_join" title="Member function timed_join() DEPRECATED"><code class="computeroutput"><span class="identifier">timed_join</span><span class="special">()</span></code></a>
+ </li>
+<li class="listitem">
+ <a class="link" href="synchronization.html#thread.synchronization.condvar_ref.condition_variable.timed_wait" title="bool timed_wait(boost::unique_lock<boost::mutex>& lock,boost::system_time const& abs_time)"><code class="computeroutput"><span class="identifier">timed_wait</span><span class="special">()</span></code></a>
+ </li>
+<li class="listitem">
+ <a class="link" href="synchronization.html#thread.synchronization.mutex_concepts.timed_lockable.timed_lock" title="m.timed_lock(abs_time)"><code class="computeroutput"><span class="identifier">timed_lock</span><span class="special">()</span></code></a>
+ </li>
+</ul></div>
<p>
- <code class="computeroutput"><span class="identifier">BOOST_THREAD_USES_CHRONO</span></code>
- is defined when Boost.Thread uses Boost.Chrono.
+ When <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span><span class="special"><=</span><span class="number">3</span></code> &&
+ defined BOOST_THREAD_PLATFORM_PTHREAD define <code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_USE_DATETIME</span></code>
+ if you don't want to use Boost.DateTime related interfaces. When <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span><span class="special">></span><span class="number">3</span></code> && defined BOOST_THREAD_PLATFORM_PTHREAD
+ define <code class="computeroutput"><span class="identifier">BOOST_THREAD_USES_DATETIME</span></code>
+ if you want to use Boost.DateTime related interfaces.
</p>
+<div class="warning"><table border="0" summary="Warning">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="../../../doc/src/images/warning.png"></td>
+<th align="left">Warning</th>
+</tr>
+<tr><td align="left" valign="top"><p>
+ When defined BOOST_THREAD_PLATFORM_WIN32 BOOST_THREAD_USES_DATETIME is
+ defined independently of user settings.
+ </p></td></tr>
+</table></div>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
-<a name="thread.build.configuration.move"></a><a class="link" href="build.html#thread.build.configuration.move" title="Boost.Move">Boost.Move</a>
+<a name="thread.build.configuration.move0"></a><a class="link" href="build.html#thread.build.configuration.move0" title="Boost.Atomic">Boost.Atomic</a>
</h4></div></div></div>
<p>
- Boost.Thread uses by default an internal move semantic implementation.
- Since version 3.0.0 you can use the move emulation emulation provided by
- Boost.Move.
+ Boost.Thread uses by default an Boost.Atomic in POSIX platforms to implement
+ call_once..
</p>
<p>
- When <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span><span class="special">==</span><span class="number">2</span></code> define
- <code class="computeroutput"><span class="identifier">BOOST_THREAD_USES_MOVE</span> </code>
- if you want to use Boost.Move interface. When <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span><span class="special">==</span><span class="number">3</span></code> define
- <code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_USE_MOVE</span> </code>
- if you want to use boost::unique_future.
+ Define <code class="computeroutput"><span class="identifier">BOOST_THREAD_USES_ATOMIC</span>
+ </code> if you want to use Boost.Atomic. Define <code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_USE_ATOMIC</span>
+ </code> if you don't want to use Boost.Atomic or if it is not supported
+ in your platform.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="thread.build.configuration.thread_eq"></a><a class="link" href="build.html#thread.build.configuration.thread_eq" title="boost::thread::operator== deprecated"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span><span class="special">::</span><span class="keyword">operator</span><span class="special">==</span></code>
+ deprecated</a>
+</h4></div></div></div>
+<p>
+ The following operators are deprecated:
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
+<li class="listitem">
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span><span class="special">::</span><span class="keyword">operator</span><span class="special">==</span></code>
+ </li>
+<li class="listitem">
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span><span class="special">::</span><span class="keyword">operator</span><span class="special">!=</span></code>
+ </li>
+</ul></div>
+<p>
+ When <code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_THREAD_EQ</span></code>
+ is defined Boost.Thread provides these deprecated feature.
+ </p>
+<p>
+ Use instead
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
+<li class="listitem">
+ <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><span class="special">::</span><span class="keyword">operator</span><span class="special">==</span></code>
+ </li>
+<li class="listitem">
+ <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><span class="special">::</span><span class="keyword">operator</span><span class="special">!=</span></code>
+ </li>
+</ul></div>
+<div class="warning"><table border="0" summary="Warning">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="../../../doc/src/images/warning.png"></td>
+<th align="left">Warning</th>
+</tr>
+<tr><td align="left" valign="top"><p>
+ This is a breaking change respect to version 1.x.
+ </p></td></tr>
+</table></div>
+<p>
+ When <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span><span class="special">>=</span><span class="number">4</span></code> define
+ <code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_THREAD_EQ</span>
+ </code> if you want this feature. When <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span><span class="special"><</span><span class="number">4</span></code> define
+ <code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_PROVIDE_THREAD_EQ</span>
+ </code> if you don't want this feature.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="thread.build.configuration.condition"></a><a class="link" href="build.html#thread.build.configuration.condition" title="boost::condition deprecated">boost::condition
+ deprecated</a>
+</h4></div></div></div>
+<p>
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">condition</span></code> is deprecated. When <code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_CONDITION</span></code> is defined
+ Boost.Thread provides this deprecated feature.
+ </p>
+<p>
+ Use instead <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">condition_variable_any</span></code>.
+ </p>
+<div class="warning"><table border="0" summary="Warning">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="../../../doc/src/images/warning.png"></td>
+<th align="left">Warning</th>
+</tr>
+<tr><td align="left" valign="top"><p>
+ This is a breaking change respect to version 1.x.
+ </p></td></tr>
+</table></div>
+<p>
+ When <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span><span class="special">></span><span class="number">3</span></code> define
+ <code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_CONDITION</span></code>
+ if you want this feature. When <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span><span class="special"><=</span><span class="number">3</span></code> define
+ <code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_PROVIDE_CONDITION</span></code>
+ if you don't want this feature.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="thread.build.configuration.nested_lock"></a><a class="link" href="build.html#thread.build.configuration.nested_lock" title="Mutex nested lock types deprecated">Mutex nested
+ lock types deprecated</a>
+</h4></div></div></div>
+<p>
+ The following nested typedefs are deprecated:
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
+<li class="listitem">
+ <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 class="listitem">
+ <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_try_lock</span></code>,
+ </li>
+<li class="listitem">
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">timed_mutex</span><span class="special">::</span><span class="identifier">scoped_lock</span></code>
+ </li>
+<li class="listitem">
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">timed_mutex</span><span class="special">::</span><span class="identifier">scoped_try_lock</span></code>
+ </li>
+<li class="listitem">
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">timed_mutex</span><span class="special">::</span><span class="identifier">timed_scoped_timed_lock</span></code>
+ </li>
+<li class="listitem">
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">recursive_mutex</span><span class="special">::</span><span class="identifier">scoped_lock</span></code>,
+ </li>
+<li class="listitem">
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">recursive_mutex</span><span class="special">::</span><span class="identifier">scoped_try_lock</span></code>,
+ </li>
+<li class="listitem">
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">recursive_timed_mutex</span><span class="special">::</span><span class="identifier">scoped_lock</span></code>
+ </li>
+<li class="listitem">
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">recursive_timed_mutex</span><span class="special">::</span><span class="identifier">scoped_try_lock</span></code>
+ </li>
+<li class="listitem">
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">recursive_timed_mutex</span><span class="special">::</span><span class="identifier">timed_scoped_timed_lock</span></code>
+ </li>
+</ul></div>
+<p>
+ When <code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_NESTED_LOCKS</span></code>
+ is defined Boost.Thread provides these deprecated feature.
+ </p>
+<p>
+ Use instead * <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">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>
+ with the <code class="computeroutput"><span class="identifier">try_to_lock_t</span></code>
+ constructor, * <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>
+ * <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>
+ with the <code class="computeroutput"><span class="identifier">try_to_lock_t</span></code>
+ constructor * <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>
+ * <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">recursive_mutex</span><span class="special">></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">recursive_mutex</span><span class="special">></span></code>
+ with the <code class="computeroutput"><span class="identifier">try_to_lock_t</span></code>
+ constructor, * <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">recursive_timed_mutex</span><span class="special">></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">recursive_timed_mutex</span><span class="special">></span></code>
+ with the <code class="computeroutput"><span class="identifier">try_to_lock_t</span></code>
+ constructor * <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">recursive_timed_mutex</span><span class="special">></span></code>
+ </p>
+<div class="warning"><table border="0" summary="Warning">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="../../../doc/src/images/warning.png"></td>
+<th align="left">Warning</th>
+</tr>
+<tr><td align="left" valign="top"><p>
+ This is a breaking change respect to version 1.x.
+ </p></td></tr>
+</table></div>
+<p>
+ When <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span><span class="special">>=</span><span class="number">4</span></code> define
+ <code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_NESTED_LOCKS</span></code>
+ if you want these features. When <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span><span class="special"><</span><span class="number">4</span></code> define
+ <code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_PROVIDE_NESTED_LOCKS</span></code>
+ if you don't want thes features.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="thread.build.configuration.id"></a><a class="link" href="build.html#thread.build.configuration.id" title="thread::id">thread::id</a>
+</h4></div></div></div>
+<p>
+ Boost.Thread uses by default a thread::id on Posix based on the pthread
+ type (BOOST_THREAD_PROVIDES_BASIC_THREAD_ID). For backward compatibility
+ and also for compilers that don't work well with this modification the
+ user can define <code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_PROVIDE_BASIC_THREAD_ID</span></code>.
+ </p>
+<p>
+ Define <code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_PROVIDE_BASIC_THREAD_ID</span>
+ </code> if you don't want these features.
</p>
</div>
<div class="section">
<p>
When <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span><span class="special">==</span><span class="number">2</span></code> define
<code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN</span>
- </code> if you want these features. When <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span><span class="special">==</span><span class="number">3</span></code> define
+ </code> if you want these features. When <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span><span class="special">>=</span><span class="number">3</span></code> define
<code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_PROVIDE_GENERIC_SHARED_MUTEX_ON_WIN</span>
</code> if you don't want these features.
</p>
Upwards Conversion</a>
</h4></div></div></div>
<p>
- Boost.Threads includes in version 2 the Shared Locking Upwards Conversion
+ Boost.Threads includes in version 3 the Shared Locking Upwards Conversion
as defined in <a href="http://home.roadrunner.com/~hinnant/bloomington/shared_mutex.html" target="_top">Shared
Locking</a>. These conversions need to be used carefully to avoid deadlock
or livelock. The user need to define explicitly <code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSION</span></code>
<p>
When <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span><span class="special">==</span><span class="number">2</span></code> define
<code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSION</span>
- </code> if you want these features. When <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span><span class="special">==</span><span class="number">3</span></code> define
+ </code> if you want these features. When <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span><span class="special">>=</span><span class="number">3</span></code> define
<code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_PROVIDE_SHARED_MUTEX_UPWARDS_CONVERSION</span>
</code> if you don't want these features.
</p>
<p>
When <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span><span class="special">==</span><span class="number">2</span></code> define
<code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_FUTURE</span></code>
- if you want to use boost::future. When <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span><span class="special">==</span><span class="number">3</span></code> define
+ if you want to use boost::future. When <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span><span class="special">>=</span><span class="number">3</span></code> define
<code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_PROVIDE_FUTURE</span></code>
if you want to use boost::unique_future.
</p>
<p>
When <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span><span class="special">==</span><span class="number">2</span></code> define
<code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_PROVIDE_PROMISE_LAZY</span>
- </code> if you want to use boost::future. When <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span><span class="special">==</span><span class="number">3</span></code> define
+ </code> if you want to use boost::future. When <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span><span class="special">>=</span><span class="number">3</span></code> define
<code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_PROMISE_LAZY</span>
</code> if you want to use boost::unique_future.
</p>
where
</p>
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">allocator_arg_t</span> <span class="special">{</span> <span class="special">};</span>
-<span class="identifier">constexpr</span> <span class="identifier">allocator_arg_t</span> <span class="identifier">allocator_arg</span> <span class="special">=</span> <span class="identifier">allocator_arg_t</span><span class="special">();</span>
+<span class="keyword">constexpr</span> <span class="identifier">allocator_arg_t</span> <span class="identifier">allocator_arg</span> <span class="special">=</span> <span class="identifier">allocator_arg_t</span><span class="special">();</span>
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Alloc</span><span class="special">></span> <span class="keyword">struct</span> <span class="identifier">uses_allocator</span><span class="special">;</span>
</pre>
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span>
<span class="special">{</span>
<span class="keyword">typedef</span> <span class="identifier">container</span><span class="special">::</span><span class="identifier">allocator_arg_t</span> <span class="identifier">allocator_arg_t</span><span class="special">;</span>
- <span class="identifier">constexpr</span> <span class="identifier">allocator_arg_t</span> <span class="identifier">allocator_arg</span> <span class="special">=</span> <span class="special">{};</span>
+ <span class="keyword">constexpr</span> <span class="identifier">allocator_arg_t</span> <span class="identifier">allocator_arg</span> <span class="special">=</span> <span class="special">{};</span>
<span class="keyword">namespace</span> <span class="identifier">container</span>
<span class="special">{</span>
<p>
When <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span><span class="special">==</span><span class="number">2</span></code> define
<code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_FUTURE_CTOR_ALLOCATORS</span>
- </code> if you want these features. When <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span><span class="special">==</span><span class="number">3</span></code> define
+ </code> if you want these features. When <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span><span class="special">>=</span><span class="number">3</span></code> define
<code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_PROVIDE_FUTURE_CTOR_ALLOCATORS</span>
</code> if you don't want these features.
</p>
<p>
When <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span><span class="special">==</span><span class="number">2</span></code> define
<code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_THREAD_DESTRUCTOR_CALLS_TERMINATE_IF_JOINABLE</span>
- </code> if you want these features. When <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span><span class="special">==</span><span class="number">3</span></code> define
+ </code> if you want these features. When <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span><span class="special">>=</span><span class="number">3</span></code> define
<code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_PROVIDE_THREAD_DESTRUCTOR_CALLS_TERMINATE_IF_JOINABLE</span>
</code> if you don't want these features.
</p>
<p>
When <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span><span class="special">==</span><span class="number">2</span></code> define
<code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_THREAD_MOVE_ASSIGN_CALLS_TERMINATE_IF_JOINABLE</span>
- </code> if you want these features. When <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span><span class="special">==</span><span class="number">3</span></code> define
+ </code> if you want these features. When <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span><span class="special">>=</span><span class="number">3</span></code> define
<code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_PROVIDE_THREAD_MOVE_ASSIGN_CALLS_TERMINATE_IF_JOINABLE</span>
</code> if you don't want these features.
</p>
<p>
When <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span><span class="special">==</span><span class="number">2</span></code> define
<code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_ONCE_CXX11</span></code>
- if you want these features. When <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span><span class="special">==</span><span class="number">3</span></code> define
+ if you want these features. When <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span><span class="special">>=</span><span class="number">3</span></code> define
<code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_PROVIDE_ONCE_CXX11</span></code>
if you don't want these features.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
-<a name="thread.build.configuration.deprecated"></a><a class="link" href="build.html#thread.build.configuration.deprecated" title="Deprecated">Deprecated</a>
+<a name="thread.build.configuration.deprecated"></a><a class="link" href="build.html#thread.build.configuration.deprecated" title="Signature parameter for packaged_task">Signature parameter
+ for packaged_task</a>
</h4></div></div></div>
<p>
- Version 3.0.0 deprecates some Boost.Thread features.
+ C++11 packaged task class has a Signature template parameter. When <code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK</span>
+ </code> is defined Boost.Thread provides this C++ feature.
</p>
+<div class="warning"><table border="0" summary="Warning">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="../../../doc/src/images/warning.png"></td>
+<th align="left">Warning</th>
+</tr>
+<tr><td align="left" valign="top"><p>
+ This is a breaking change respect to version 3.x.
+ </p></td></tr>
+</table></div>
<p>
- These deprecated features will be provided by default up to boost 1.52.
- If you don't want to include the deprecated features you could define
- <code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_PROVIDE_DEPRECATED_FEATURES_SINCE_V3_0_0</span></code>.
- Since 1.53 these features will not be included any more by default. Since
- this version, if you want to include the deprecated features yet you could
- define <code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDE_DEPRECATED_FEATURES_SINCE_V3_0_0</span></code>.
- These deprecated features will be only available until boost 1.55, that
- is you have 1 year and a half to move to the new features.
+ When <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span><span class="special"><</span><span class="number">4</span></code> define
+ <code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK</span></code>
+ if you want this feature. When <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span><span class="special">>=</span><span class="number">4</span></code> define
+ <code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_PROVIDE_SIGNATURE_PACKAGED_TASK</span></code>
+ if you don't want this feature.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
-<a name="thread.build.configuration.version"></a><a class="link" href="build.html#thread.build.configuration.version" title="Version">Version</a>
+<a name="thread.build.configuration.thread_const"></a><a class="link" href="build.html#thread.build.configuration.thread_const" title="-var thread constructor with variadic rvalue parameters">-var thread
+ constructor with variadic rvalue parameters</a>
</h4></div></div></div>
<p>
- <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span></code> defines
- the Boost.Thread version. The default version is 2. In this case the following
- breaking or extending macros are defined if the opposite is not requested:
+ C++11 thread constructor accep a variable number of rvalue argumentshas.
+ When <code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_VARIADIC_THREAD</span>
+ </code> is defined Boost.Thread provides this C++ feature if the following
+ are not defined
</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
- <code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_PROMISE_LAZY</span></code>
+ BOOST_NO_SFINAE_EXPR
+ </li>
+<li class="listitem">
+ BOOST_NO_CXX11_VARIADIC_TEMPLATES
+ </li>
+<li class="listitem">
+ BOOST_NO_CXX11_DECLTYPE
+ </li>
+<li class="listitem">
+ BOOST_NO_CXX11_DECLTYPE_N3276
+ </li>
+<li class="listitem">
+ BOOST_NO_CXX11_RVALUE_REFERENCES
+ </li>
+<li class="listitem">
+ BOOST_NO_CXX11_TRAILING_RESULT_TYPES
</li>
<li class="listitem">
- <code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_DEPRECATED_FEATURES_SINCE_V3_0_0</span></code>
+ BOOST_NO_CXX11_RVALUE_REFERENCES
+ </li>
+<li class="listitem">
+ BOOST_NO_CXX11_HDR_TUPLE
</li>
</ul></div>
<p>
+ When <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span><span class="special">></span><span class="number">4</span></code> define
+ <code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_PROVIDE_VARIADIC_THREAD</span>
+ </code> if you don't want this feature.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="thread.build.configuration.get_invalid"></a><a class="link" href="build.html#thread.build.configuration.get_invalid" title="future<>::get() invalidates the future">future<>::get()
+ invalidates the future</a>
+</h4></div></div></div>
+<p>
+ C++11 future<>::get() invalidates the future once its value has been
+ obtained. When <code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_FUTURE_INVALID_AFTER_GET</span>
+ </code> is defined Boost.Thread provides this C++ feature.
+ </p>
+<div class="warning"><table border="0" summary="Warning">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="../../../doc/src/images/warning.png"></td>
+<th align="left">Warning</th>
+</tr>
+<tr><td align="left" valign="top"><p>
+ This is a breaking change respect to version 3.x.
+ </p></td></tr>
+</table></div>
+<p>
+ When <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span><span class="special"><</span><span class="number">4</span></code> define
+ <code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_FUTURE_INVALID_AFTER_GET</span></code>
+ if you want this feature. When <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span><span class="special">>=</span><span class="number">4</span></code> define
+ <code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_PROVIDE_FUTURE_INVALID_AFTER_GET</span></code>
+ if you don't want this feature.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="thread.build.configuration.intr"></a><a class="link" href="build.html#thread.build.configuration.intr" title="Interruptions">Interruptions</a>
+</h4></div></div></div>
+<p>
+ Thread interruption, while useful, makes any interruption point less efficient
+ than if the thread were not interruptible.
+ </p>
+<p>
+ When <code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_INTERRUPTIONS</span></code>
+ is defined Boost.Thread provides interruptions. When <code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_PROVIDE_INTERRUPTIONS</span></code>
+ is defined Boost.Thread don't provide interruption.
+ </p>
+<p>
+ Boost.Thread defines BOOST_THREAD_PROVIDES_INTERRUPTIONS if neither BOOST_THREAD_PROVIDES_INTERRUPTIONS
+ nor BOOST_THREAD_DONT_PROVIDE_INTERRUPTIONS are defined, so that there
+ is no compatibility break.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="thread.build.configuration.version"></a><a class="link" href="build.html#thread.build.configuration.version" title="Version">Version</a>
+</h4></div></div></div>
+<p>
+ <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span></code> defines
+ the Boost.Thread version. The default version is 2. In this case the following
+ breaking or extending macros are defined if the opposite is not requested:
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
+ <code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_PROMISE_LAZY</span></code>
+ </li></ul></div>
+<p>
The user can request the version 3 by defining <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span></code>
to 3. In this case the following breaking or extending macros are defined
if the opposite is not requested:
</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
Breaking change <code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_EXPLICIT_LOCK_CONVERSION</span>
</code>
</li>
<li class="listitem">
- Breaking change <code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_FUTURE</span></code>
+ Conformity & Breaking change <code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_FUTURE</span></code>
</li>
<li class="listitem">
Uniformity <code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN</span></code>
Conformity <code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_FUTURE_CTOR_ALLOCATORS</span></code>
</li>
<li class="listitem">
- Breaking change BOOST_THREAD_PROVIDES_THREAD_DESTRUCTOR_CALLS_TERMINATE_IF_JOINABLE
+ Conformity & Breaking change BOOST_THREAD_PROVIDES_THREAD_DESTRUCTOR_CALLS_TERMINATE_IF_JOINABLE
</li>
<li class="listitem">
- Breaking change BOOST_THREAD_PROVIDES_THREAD_MOVE_ASSIGN_CALLS_TERMINATE_IF_JOINABLE
+ Conformity & Breaking change BOOST_THREAD_PROVIDES_THREAD_MOVE_ASSIGN_CALLS_TERMINATE_IF_JOINABLE
</li>
<li class="listitem">
- Breaking change <code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_ONCE_CXX11</span></code>
+ Conformity & Breaking change <code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_ONCE_CXX11</span></code>
</li>
<li class="listitem">
Breaking change <code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_PROVIDE_PROMISE_LAZY</span></code>
</li>
-<li class="listitem">
- Breaking change <code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_PROVIDE_DEPRECATED_FEATURES_SINCE_V3_0_0</span></code>
- </li>
</ul></div>
<p>
- The default value for <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span></code>
- will be changed to 3 since Boost 1.53.
+ The user can request the version 4 by defining <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span></code>
+ to 4. In this case the following breaking or extending macros are defined
+ if the opposite is not requested:
</p>
+<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
+<li class="listitem">
+ Conformity & Breaking change <code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK</span>
+ </code>
+ </li>
+<li class="listitem">
+ Conformity & Breaking change <code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_FUTURE_INVALID_AFTER_GET</span>
+ </code>
+ </li>
+<li class="listitem">
+ Conformity <code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_VARIADIC_THREAD</span></code>
+ </li>
+<li class="listitem">
+ Breaking change <code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_PROVIDE_THREAD_EQ</span></code>
+ </li>
+<li class="listitem">
+ Breaking change <code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_USE_DATETIME</span></code>
+ </li>
+</ul></div>
</div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="thread.build.limitations"></a><a class="link" href="build.html#thread.build.limitations" title="Limitations">Limitations</a>
</h3></div></div></div>
-<div class="toc"><dl>
+<div class="toc"><dl class="toc">
<dt><span class="section"><a href="build.html#thread.build.limitations.sun">SunPro</a></span></dt>
<dt><span class="section"><a href="build.html#thread.build.limitations.vacpp">VACPP</a></span></dt>
+<dt><span class="section"><a href="build.html#thread.build.limitations.ce">WCE</a></span></dt>
</dl></div>
<p>
Some compilers don't work correctly with some of the added features.
<p>
If __SUNPRO_CC < 0x5100 the library defines
</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="disc">
-<li class="listitem">
+<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
<code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_USE_MOVE</span></code>
- </li>
-<li class="listitem">
+ </li></ul></div>
+<p>
+ If __SUNPRO_CC < 0x5100 the library defines
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
<code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_PROVIDE_FUTURE_CTOR_ALLOCATORS</span></code>
- </li>
-</ul></div>
+ </li></ul></div>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="thread.build.limitations.vacpp"></a><a class="link" href="build.html#thread.build.limitations.vacpp" title="VACPP">VACPP</a>
</h4></div></div></div>
<p>
- If __IBMCPP__ is defined the library defines
+ If __IBMCPP__ < 1100 the library defines
</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
+<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
+<li class="listitem">
<code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_USE_CHRONO</span></code>
- </li></ul></div>
+ </li>
+<li class="listitem">
+ <code class="computeroutput"><span class="identifier">BOOST_THREAD_USES_DATE</span></code>
+ </li>
+</ul></div>
<p>
And Boost.Thread doesn't links with Boost.Chrono.
</p>
</div>
+<div class="section">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="thread.build.limitations.ce"></a><a class="link" href="build.html#thread.build.limitations.ce" title="WCE">WCE</a>
+</h4></div></div></div>
+<p>
+ If _WIN32_WCE && _WIN32_WCE==0x501 the library defines
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
+ <code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_PROVIDE_FUTURE_CTOR_ALLOCATORS</span></code>
+ </li></ul></div>
+</div>
</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 -11 Anthony Williams<br>Copyright © 2011 -12 Vicente J. Botet Escriba<p>
+<td align="right"><div class="copyright-footer">Copyright © 2007 -11 Anthony Williams<br>Copyright © 2011 -14 Vicente J. Botet Escriba<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>