3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>Using and building the library</title>
5 <link rel="stylesheet" href="../../../doc/src/boostbook.css" type="text/css">
6 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
7 <link rel="home" href="../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
8 <link rel="up" href="../thread.html" title="Chapter 28. Thread 3.0.1">
9 <link rel="prev" href="../thread.html" title="Chapter 28. Thread 3.0.1">
10 <link rel="next" href="changes.html" title="History">
12 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13 <table cellpadding="2" width="100%"><tr>
14 <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../boost.png"></td>
15 <td align="center"><a href="../../../index.html">Home</a></td>
16 <td align="center"><a href="../../../libs/libraries.htm">Libraries</a></td>
17 <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
18 <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
19 <td align="center"><a href="../../../more/index.htm">More</a></td>
22 <div class="spirit-nav">
23 <a accesskey="p" href="../thread.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../thread.html"><img src="../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="changes.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
26 <div class="titlepage"><div><div><h2 class="title" style="clear: both">
27 <a name="thread.build"></a><a class="link" href="build.html" title="Using and building the library">Using and building the library</a>
28 </h2></div></div></div>
30 <dt><span class="section"><a href="build.html#thread.build.configuration">Configuration</a></span></dt>
31 <dt><span class="section"><a href="build.html#thread.build.limitations">Limitations</a></span></dt>
34 Boost.Thread is configured following the conventions used to build <a href="http://www.boost.org/doc/libs/1_48_0/libs/config/doc/html/boost_config/boost_macro_reference.html#boost_config.boost_macro_reference.macros_for_libraries_with_separate_source_code" target="_top">libraries
35 with separate source code</a>. Boost.Thread will import/export the code
36 only if the user has specifically asked for it, by defining either BOOST_ALL_DYN_LINK
37 if they want all boost libraries to be dynamically linked, or BOOST_THREAD_DYN_LINK
38 if they want just this one to be dynamically liked.
41 The definition of these macros determines whether BOOST_THREAD_USE_DLL is defined.
42 If BOOST_THREAD_USE_DLL is not defined, the library will define BOOST_THREAD_USE_DLL
43 or BOOST_THREAD_USE_LIB depending on whether the platform. On non windows platforms
44 BOOST_THREAD_USE_LIB is defined if is not defined. In windows platforms, BOOST_THREAD_USE_LIB
45 is defined if BOOST_THREAD_USE_DLL and the compiler supports auto-tss cleanup
46 with Boost.Threads (for the time been Msvc and Intel)
49 The source code compiled when building the library defines a macros BOOST_THREAD_SOURCE
50 that is used to import or export it. The user must not define this macro in
54 The following section describes all the macros used to configure Boost.Thread.
57 <div class="titlepage"><div><div><h3 class="title">
58 <a name="thread.build.configuration"></a><a class="link" href="build.html#thread.build.configuration" title="Configuration">Configuration</a>
59 </h3></div></div></div>
61 <dt><span class="section"><a href="build.html#thread.build.configuration.system">Boost.System</a></span></dt>
62 <dt><span class="section"><a href="build.html#thread.build.configuration.chrono">Boost.Chrono</a></span></dt>
63 <dt><span class="section"><a href="build.html#thread.build.configuration.move">Boost.Move</a></span></dt>
64 <dt><span class="section"><a href="build.html#thread.build.configuration.shared_gen">Shared Locking
65 Generic</a></span></dt>
66 <dt><span class="section"><a href="build.html#thread.build.configuration.shared_upwards">Shared Locking
67 Upwards Conversion</a></span></dt>
68 <dt><span class="section"><a href="build.html#thread.build.configuration.explicit_cnv">Explicit Lock
69 Conversion</a></span></dt>
70 <dt><span class="section"><a href="build.html#thread.build.configuration.future">unique_future versus
71 future</a></span></dt>
72 <dt><span class="section"><a href="build.html#thread.build.configuration.lazy">promise lazy initialization</a></span></dt>
73 <dt><span class="section"><a href="build.html#thread.build.configuration.alloc">promise Allocator
74 constructor</a></span></dt>
75 <dt><span class="section"><a href="build.html#thread.build.configuration.terminate">Call to terminate
76 if joinable</a></span></dt>
77 <dt><span class="section"><a href="build.html#thread.build.configuration.once_flag">once_flag</a></span></dt>
78 <dt><span class="section"><a href="build.html#thread.build.configuration.deprecated">Deprecated</a></span></dt>
79 <dt><span class="section"><a href="build.html#thread.build.configuration.version">Version</a></span></dt>
82 <div class="titlepage"><div><div><h4 class="title">
83 <a name="thread.build.configuration.system"></a><a class="link" href="build.html#thread.build.configuration.system" title="Boost.System">Boost.System</a>
84 </h4></div></div></div>
86 Boost.Thread uses by default Boost.System to define the exceptions. For
87 backward compatibility and also for compilers that don't work well with
88 Boost.System the user can define <code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_USE_SYSTEM</span>
92 <code class="computeroutput"><span class="identifier">BOOST_THREAD_USES_SYSTEM</span></code>
93 is defined when Boost.Thread uses Boost.Move.
97 <div class="titlepage"><div><div><h4 class="title">
98 <a name="thread.build.configuration.chrono"></a><a class="link" href="build.html#thread.build.configuration.chrono" title="Boost.Chrono">Boost.Chrono</a>
99 </h4></div></div></div>
101 Boost.Thread uses by default Boost.Chrono for the time related functions.
102 For backward compatibility and also for compilers that don't work well
103 with Boost.Chrono the user can define <code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_USE_CHRONO</span></code>.
104 If <code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_USE_SYSTEM</span></code>
105 is defined then <code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_USE_CHRONO</span></code>
106 is defined implicitly.
109 <code class="computeroutput"><span class="identifier">BOOST_THREAD_USES_CHRONO</span></code>
110 is defined when Boost.Thread uses Boost.Chrono.
113 <div class="section">
114 <div class="titlepage"><div><div><h4 class="title">
115 <a name="thread.build.configuration.move"></a><a class="link" href="build.html#thread.build.configuration.move" title="Boost.Move">Boost.Move</a>
116 </h4></div></div></div>
118 Boost.Thread uses by default an internal move semantic implementation.
119 Since version 3.0.0 you can use the move emulation emulation provided by
123 When <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span><span class="special">==</span><span class="number">2</span></code> define
124 <code class="computeroutput"><span class="identifier">BOOST_THREAD_USES_MOVE</span> </code>
125 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
126 <code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_USE_MOVE</span> </code>
127 if you want to use boost::unique_future.
130 <div class="section">
131 <div class="titlepage"><div><div><h4 class="title">
132 <a name="thread.build.configuration.shared_gen"></a><a class="link" href="build.html#thread.build.configuration.shared_gen" title="Shared Locking Generic">Shared Locking
134 </h4></div></div></div>
136 The shared mutex implementation on Windows platform provides currently
137 less functionality than the generic one that is used for PTheads based
138 platforms. In order to have access to these functions, the user needs to
139 define <code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN</span></code>
140 to use the generic implementation, that while could be less efficient,
141 provides all the functions.
144 When <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span><span class="special">==</span><span class="number">2</span></code> define
145 <code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN</span>
146 </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
147 <code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_PROVIDE_GENERIC_SHARED_MUTEX_ON_WIN</span>
148 </code> if you don't want these features.
151 <div class="section">
152 <div class="titlepage"><div><div><h4 class="title">
153 <a name="thread.build.configuration.shared_upwards"></a><a class="link" href="build.html#thread.build.configuration.shared_upwards" title="Shared Locking Upwards Conversion">Shared Locking
154 Upwards Conversion</a>
155 </h4></div></div></div>
157 Boost.Threads includes in version 2 the Shared Locking Upwards Conversion
158 as defined in <a href="http://home.roadrunner.com/~hinnant/bloomington/shared_mutex.html" target="_top">Shared
159 Locking</a>. These conversions need to be used carefully to avoid deadlock
160 or livelock. The user need to define explicitly <code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSION</span></code>
161 to get these upwards conversions.
164 When <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span><span class="special">==</span><span class="number">2</span></code> define
165 <code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSION</span>
166 </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
167 <code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_PROVIDE_SHARED_MUTEX_UPWARDS_CONVERSION</span>
168 </code> if you don't want these features.
171 <div class="section">
172 <div class="titlepage"><div><div><h4 class="title">
173 <a name="thread.build.configuration.explicit_cnv"></a><a class="link" href="build.html#thread.build.configuration.explicit_cnv" title="Explicit Lock Conversion">Explicit Lock
175 </h4></div></div></div>
177 In <a href="http://home.roadrunner.com/~hinnant/bloomington/shared_mutex.html" target="_top">Shared
178 Locking</a> the lock conversions are explicit. As this explicit conversion
179 breaks the lock interfaces, it is provided only if the <code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_EXPLICIT_LOCK_CONVERSION</span></code>
183 When <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span><span class="special">==</span><span class="number">2</span></code> define
184 <code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_EXPLICIT_LOCK_CONVERSION</span>
185 </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
186 <code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_PROVIDE_EXPLICIT_LOCK_CONVERSION</span>
187 </code> if you don't want these features.
190 <div class="section">
191 <div class="titlepage"><div><div><h4 class="title">
192 <a name="thread.build.configuration.future"></a><a class="link" href="build.html#thread.build.configuration.future" title="unique_future versus future">unique_future versus
194 </h4></div></div></div>
196 C++11 uses <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">future</span></code>. Versions of Boost.Thread previous
197 to version 3.0.0 uses <code class="computeroutput"><span class="identifier">boost</span><span class="special">:</span><span class="identifier">unique_future</span></code>.
198 Since version 3.0.0 <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">future</span></code>
199 replaces <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">unique_future</span></code> when <code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_FUTURE</span></code>
200 is defined. The documentation doesn't contains anymore however <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">unique_future</span></code>.
203 When <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span><span class="special">==</span><span class="number">2</span></code> define
204 <code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_FUTURE</span></code>
205 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
206 <code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_PROVIDE_FUTURE</span></code>
207 if you want to use boost::unique_future.
210 <div class="section">
211 <div class="titlepage"><div><div><h4 class="title">
212 <a name="thread.build.configuration.lazy"></a><a class="link" href="build.html#thread.build.configuration.lazy" title="promise lazy initialization">promise lazy initialization</a>
213 </h4></div></div></div>
215 C++11 promise initialize the associated state at construction time. Versions
216 of Boost.Thread previous to version 3.0.0 initialize it lazily at any point
217 in time in which this associated state is needed.
220 Since version 3.0.0 this difference in behavior can be configured. When
221 <code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_PROMISE_LAZY</span></code>
222 is defined the backward compatible behavior is provided.
225 When <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span><span class="special">==</span><span class="number">2</span></code> define
226 <code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_PROVIDE_PROMISE_LAZY</span>
227 </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
228 <code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_PROMISE_LAZY</span>
229 </code> if you want to use boost::unique_future.
232 <div class="section">
233 <div class="titlepage"><div><div><h4 class="title">
234 <a name="thread.build.configuration.alloc"></a><a class="link" href="build.html#thread.build.configuration.alloc" title="promise Allocator constructor">promise Allocator
236 </h4></div></div></div>
238 C++11 std::promise provides constructors with allocators.
240 <pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">R</span><span class="special">></span>
241 <span class="keyword">class</span> <span class="identifier">promise</span>
242 <span class="special">{</span>
243 <span class="keyword">public</span><span class="special">:</span>
244 <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Allocator</span><span class="special">></span>
245 <span class="keyword">explicit</span> <span class="identifier">promise</span><span class="special">(</span><span class="identifier">allocator_arg_t</span><span class="special">,</span> <span class="identifier">Allocator</span> <span class="identifier">a</span><span class="special">);</span>
246 <span class="comment">// ...</span>
247 <span class="special">};</span>
248 <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R</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><span class="identifier">promise</span><span class="special"><</span><span class="identifier">R</span><span class="special">>,</span><span class="identifier">Alloc</span><span class="special">>:</span> <span class="identifier">true_type</span> <span class="special">{};</span>
253 <pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">allocator_arg_t</span> <span class="special">{</span> <span class="special">};</span>
254 <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>
256 <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>
259 Since version 3.0.0 Boost.Thread implements this constructor using the
262 <pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span>
263 <span class="special">{</span>
264 <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>
265 <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>
267 <span class="keyword">namespace</span> <span class="identifier">container</span>
268 <span class="special">{</span>
269 <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Alloc</span><span class="special">></span>
270 <span class="keyword">struct</span> <span class="identifier">uses_allocator</span><span class="special"><</span><span class="identifier">promise</span><span class="special"><</span><span class="identifier">R</span><span class="special">>,</span><span class="identifier">Alloc</span><span class="special">>:</span> <span class="identifier">true_type</span> <span class="special">{};</span>
271 <span class="special">}</span>
272 <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>
273 <span class="keyword">struct</span> <span class="identifier">uses_allocator</span> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">container</span><span class="special">::</span><span class="identifier">uses_allocator</span><span class="special"><</span><span class="identifier">T</span><span class="special">,</span> <span class="identifier">Alloc</span><span class="special">></span> <span class="special">{};</span>
274 <span class="special">}</span>
277 which introduces a dependency on Boost.Container. This feature is provided
278 only if <code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_FUTURE_CTOR_ALLOCATORS</span></code>
282 When <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span><span class="special">==</span><span class="number">2</span></code> define
283 <code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_FUTURE_CTOR_ALLOCATORS</span>
284 </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
285 <code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_PROVIDE_FUTURE_CTOR_ALLOCATORS</span>
286 </code> if you don't want these features.
289 <div class="section">
290 <div class="titlepage"><div><div><h4 class="title">
291 <a name="thread.build.configuration.terminate"></a><a class="link" href="build.html#thread.build.configuration.terminate" title="Call to terminate if joinable">Call to terminate
293 </h4></div></div></div>
295 C++11 has a different semantic for the thread destructor and the move assignment.
296 Instead of detaching the thread, calls to terminate() if the thread was
297 joinable. When <code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_THREAD_DESTRUCTOR_CALLS_TERMINATE_IF_JOINABLE</span></code>
298 and <code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_THREAD_MOVE_ASSIGN_CALLS_TERMINATE_IF_JOINABLE</span></code>
299 is defined Boost.Thread provides the C++ semantic.
302 When <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span><span class="special">==</span><span class="number">2</span></code> define
303 <code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_THREAD_DESTRUCTOR_CALLS_TERMINATE_IF_JOINABLE</span>
304 </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
305 <code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_PROVIDE_THREAD_DESTRUCTOR_CALLS_TERMINATE_IF_JOINABLE</span>
306 </code> if you don't want these features.
309 When <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span><span class="special">==</span><span class="number">2</span></code> define
310 <code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_THREAD_MOVE_ASSIGN_CALLS_TERMINATE_IF_JOINABLE</span>
311 </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
312 <code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_PROVIDE_THREAD_MOVE_ASSIGN_CALLS_TERMINATE_IF_JOINABLE</span>
313 </code> if you don't want these features.
316 <div class="section">
317 <div class="titlepage"><div><div><h4 class="title">
318 <a name="thread.build.configuration.once_flag"></a><a class="link" href="build.html#thread.build.configuration.once_flag" title="once_flag">once_flag</a>
319 </h4></div></div></div>
321 C++11 defines a default constructor for once_flag. When <code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_ONCE_CXX11</span>
322 </code> is defined Boost.Thread provides this C++ semantics. In this case,
323 the previous aggregate syntax is not supported.
325 <pre class="programlisting"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">once_flag</span> <span class="identifier">once</span> <span class="special">=</span> <span class="identifier">BOOST_ONCE_INIT</span><span class="special">;</span>
328 You should now just do
330 <pre class="programlisting"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">once_flag</span> <span class="identifier">once</span><span class="special">;</span>
333 When <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span><span class="special">==</span><span class="number">2</span></code> define
334 <code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_ONCE_CXX11</span></code>
335 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
336 <code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_PROVIDE_ONCE_CXX11</span></code>
337 if you don't want these features.
340 <div class="section">
341 <div class="titlepage"><div><div><h4 class="title">
342 <a name="thread.build.configuration.deprecated"></a><a class="link" href="build.html#thread.build.configuration.deprecated" title="Deprecated">Deprecated</a>
343 </h4></div></div></div>
345 Version 3.0.0 deprecates some Boost.Thread features.
348 These deprecated features will be provided by default up to boost 1.52.
349 If you don't want to include the deprecated features you could define
350 <code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_PROVIDE_DEPRECATED_FEATURES_SINCE_V3_0_0</span></code>.
351 Since 1.53 these features will not be included any more by default. Since
352 this version, if you want to include the deprecated features yet you could
353 define <code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDE_DEPRECATED_FEATURES_SINCE_V3_0_0</span></code>.
354 These deprecated features will be only available until boost 1.55, that
355 is you have 1 year and a half to move to the new features.
358 <div class="section">
359 <div class="titlepage"><div><div><h4 class="title">
360 <a name="thread.build.configuration.version"></a><a class="link" href="build.html#thread.build.configuration.version" title="Version">Version</a>
361 </h4></div></div></div>
363 <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span></code> defines
364 the Boost.Thread version. The default version is 2. In this case the following
365 breaking or extending macros are defined if the opposite is not requested:
367 <div class="itemizedlist"><ul class="itemizedlist" type="disc">
368 <li class="listitem">
369 <code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_PROMISE_LAZY</span></code>
371 <li class="listitem">
372 <code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_DEPRECATED_FEATURES_SINCE_V3_0_0</span></code>
376 The user can request the version 3 by defining <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span></code>
377 to 3. In this case the following breaking or extending macros are defined
378 if the opposite is not requested:
380 <div class="itemizedlist"><ul class="itemizedlist" type="disc">
381 <li class="listitem">
382 Breaking change <code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_EXPLICIT_LOCK_CONVERSION</span>
385 <li class="listitem">
386 Breaking change <code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_FUTURE</span></code>
388 <li class="listitem">
389 Uniformity <code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN</span></code>
391 <li class="listitem">
392 Extension <code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSION</span></code>
394 <li class="listitem">
395 Conformity <code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_FUTURE_CTOR_ALLOCATORS</span></code>
397 <li class="listitem">
398 Breaking change BOOST_THREAD_PROVIDES_THREAD_DESTRUCTOR_CALLS_TERMINATE_IF_JOINABLE
400 <li class="listitem">
401 Breaking change BOOST_THREAD_PROVIDES_THREAD_MOVE_ASSIGN_CALLS_TERMINATE_IF_JOINABLE
403 <li class="listitem">
404 Breaking change <code class="computeroutput"><span class="identifier">BOOST_THREAD_PROVIDES_ONCE_CXX11</span></code>
406 <li class="listitem">
407 Breaking change <code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_PROVIDE_PROMISE_LAZY</span></code>
409 <li class="listitem">
410 Breaking change <code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_PROVIDE_DEPRECATED_FEATURES_SINCE_V3_0_0</span></code>
414 The default value for <code class="computeroutput"><span class="identifier">BOOST_THREAD_VERSION</span></code>
415 will be changed to 3 since Boost 1.53.
419 <div class="section">
420 <div class="titlepage"><div><div><h3 class="title">
421 <a name="thread.build.limitations"></a><a class="link" href="build.html#thread.build.limitations" title="Limitations">Limitations</a>
422 </h3></div></div></div>
423 <div class="toc"><dl>
424 <dt><span class="section"><a href="build.html#thread.build.limitations.sun">SunPro</a></span></dt>
425 <dt><span class="section"><a href="build.html#thread.build.limitations.vacpp">VACPP</a></span></dt>
428 Some compilers don't work correctly with some of the added features.
430 <div class="section">
431 <div class="titlepage"><div><div><h4 class="title">
432 <a name="thread.build.limitations.sun"></a><a class="link" href="build.html#thread.build.limitations.sun" title="SunPro">SunPro</a>
433 </h4></div></div></div>
435 If __SUNPRO_CC < 0x5100 the library defines
437 <div class="itemizedlist"><ul class="itemizedlist" type="disc">
438 <li class="listitem">
439 <code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_USE_MOVE</span></code>
441 <li class="listitem">
442 <code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_PROVIDE_FUTURE_CTOR_ALLOCATORS</span></code>
446 <div class="section">
447 <div class="titlepage"><div><div><h4 class="title">
448 <a name="thread.build.limitations.vacpp"></a><a class="link" href="build.html#thread.build.limitations.vacpp" title="VACPP">VACPP</a>
449 </h4></div></div></div>
451 If __IBMCPP__ is defined the library defines
453 <div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
454 <code class="computeroutput"><span class="identifier">BOOST_THREAD_DONT_USE_CHRONO</span></code>
457 And Boost.Thread doesn't links with Boost.Chrono.
462 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
463 <td align="left"></td>
464 <td align="right"><div class="copyright-footer">Copyright © 2007 -11 Anthony Williams<br>Copyright © 2011 -12 Vicente J. Botet Escriba<p>
465 Distributed under the Boost Software License, Version 1.0. (See accompanying
466 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>)
471 <div class="spirit-nav">
472 <a accesskey="p" href="../thread.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../thread.html"><img src="../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="changes.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>