Skip to content

Commit 7bc8c43

Browse files
committed
Thread: merge from trunk: 1.52
[SVN r80450]
1 parent c4420d7 commit 7bc8c43

105 files changed

Lines changed: 916 additions & 710 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

build/Jamfile.v2

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,10 +236,7 @@ rule requirements ( properties * )
236236
}
237237
}
238238
}
239-
if ! <toolset>vacpp in $(properties) || <toolset-vacpp:version>11.1 in $(properties)
240-
{
241-
result += <library>/boost/chrono//boost_chrono ;
242-
}
239+
result += <define>BOOST_THREAD_DONT_USE_CHRONO ;
243240

244241
return $(result) ;
245242
}

doc/changes.qbk

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,34 @@
88

99
[section:changes History]
1010

11+
[heading Version 3.1.0 - boost 1.52]
12+
13+
New Features:
14+
15+
* [@http://svn.boost.org/trac/boost/ticket/2361 #2361] thread_specific_ptr: document nature of the key, complexity and rationale
16+
* [@http://svn.boost.org/trac/boost/ticket/4710 #4710] C++11 compliance: : Missing async()
17+
18+
Fixed Bugs:
19+
20+
* [@http://svn.boost.org/trac/boost/ticket/2797 #2797] Two problems with thread_specific_ptr
21+
* [@http://svn.boost.org/trac/boost/ticket/5274 #5274] failed to compile future.hpp with stlport 5.1.5 under msvc8.1, because of undefined class
22+
* [@http://svn.boost.org/trac/boost/ticket/5431 #5431] compile error in Windows CE 6.0(interlocked)
23+
* [@http://svn.boost.org/trac/boost/ticket/5752 #5752] boost::call_once() is unreliable on some platforms
24+
* [@http://svn.boost.org/trac/boost/ticket/5696 #5696] win32 detail::set_tss_data does nothing when tss_cleanup_function is NULL
25+
* [@http://svn.boost.org/trac/boost/ticket/7045 #7045] Thread library does not automatically compile date_time
26+
* [@http://svn.boost.org/trac/boost/ticket/7173 #7173] wrong function name interrupt_point()
27+
* [@http://svn.boost.org/trac/boost/ticket/7200 #7200] Unable to build boost.thread modularized
28+
* [@http://svn.boost.org/trac/boost/ticket/7220 #7220 7238 gcc 4.6.2 warns about inline+dllimport functions
29+
* [@http://svn.boost.org/trac/boost/ticket/7238 #5274] this_thread::sleep_for() does not respond to interrupt()
30+
* [@http://svn.boost.org/trac/boost/ticket/7245 #7245] Minor typos on documentation related to version 3
31+
* [@http://svn.boost.org/trac/boost/ticket/7272 #7272] win32/thread_primitives.hpp: (Unneccessary) Warning
32+
1133
[heading Version 3.0.1 - boost 1.51]
1234

35+
New Features:
36+
37+
* [@http://svn.boost.org/trac/boost/ticket/2100 #2100] thread fails to compile with -fno-exceptions
38+
1339
Deprecated features since boost 1.50 available only until boost 1.55:
1440

1541
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 BOOST_THREAD_DONT_PROVIDE_DEPRECATED_FEATURES_SINCE_V3_0_0. 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 BOOST_THREAD_PROVIDE_DEPRECATED_FEATURES_SINCE_V3_0_0. 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.
@@ -38,6 +64,10 @@ Fixed Bugs:
3864
* [@http://svn.boost.org/trac/boost/ticket/7078 #7078] Trivial 64-bit warning fix on Windows for thread attribute stack size
3965
* [@http://svn.boost.org/trac/boost/ticket/7089 #7089] BOOST_THREAD_WAIT_BUG limits functionality without solving anything
4066

67+
[/
68+
#6787 boost::thread::sleep() hangs if system time is rolled back
69+
#7045 Thread library does not automatically compile date_time
70+
]
4171

4272
[heading Version 3.0.0 - boost 1.50]
4373

doc/compliance.qbk

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@
2626
[[30.2.5.4] [TimedLockable requirements] [Yes] [-] [-]]
2727
[[30.2.6] [decay_copy] [-] [-] [-]]
2828
[[30.3] [Threads] [Partial] [-] [-]]
29-
[[30.3.1] [Class thread] [Partial] [move,variadic,terminate] [#zzzz,#6270,#6269]]
29+
[[30.3.1] [Class thread] [Partial] [move,variadic,terminate] [#6270]]
3030
[[30.3.1.1] [Class thread::id] [Yes] [-] [-]]
31-
[[30.3.1.2] [thread constructors] [Partial] [move,variadic] [#zzzz,#6270]]
32-
[[30.3.1.3] [thread destructor] [Partial] [terminate] [#6266]]
33-
[[30.3.1.4] [thread assignment] [Partial] [terminate] [#6269]]
31+
[[30.3.1.2] [thread constructors] [Partial] [move,variadic] [#6270]]
32+
[[30.3.1.3] [thread destructor] [Yes] [-] [-]]
33+
[[30.3.1.4] [thread assignment] [Yes] [-] [-]]
3434
[[30.3.1.5] [thread members] [Yes] [-] [-]]
3535
[[30.3.1.6] [thread static members] [Yes] [-] [-]]
3636
[[30.3.1.7] [thread specialized algorithms] [Yes] [-] [-]]
@@ -53,23 +53,23 @@
5353
[[30.4.2.2.3] [unique_lock modifiers] [Yes] [-] [-]]
5454
[[30.4.2.2.4] [unique_lock observers] [Yes] [] [-]]
5555
[[30.4.3] [Generic locking algorithms] [Partial] [variadic] [#6227]]
56-
[[30.4.4] [Call once] [Partial] [The interface doesn't corresponds] [#6342]]
57-
[[30.4.4.1] [Struct once_flag] [Partial] [interface] [#6342]]
58-
[[30.4.4.2] [Function call_once] [Partial] [interface] [#6342]]
59-
[[30.5] [Condition variables] [Partial] [notify_all_at_thread_exit] [#xxxx]]
60-
[[30.5 6-10] [Function notify_all_at_thread_exit] [No] [-] [#xxxx]]
56+
[[30.4.4] [Call once] [Partial] [call_once] [#7285]]
57+
[[30.4.4.1] [Struct once_flag] [Yes] [-] [-]]
58+
[[30.4.4.2] [Function call_once] [Partial] [interface] [#7285]]
59+
[[30.5] [Condition variables] [Partial] [notify_all_at_thread_exit] [#7283]]
60+
[[30.5 6-10] [Function notify_all_at_thread_exit] [No] [-] [#7283]]
6161
[[30.5.1] [Class condition_variable] [Yes] [-] [-]]
6262
[[30.5.2] [Class condition_variable_any] [Yes] [-] [-]]
63-
[[30.6] [Futures] [Partial] [-] [-]]
63+
[[30.6] [Futures] [Partial] [async,at_thread_exit] [#4710,#7280]]
6464
[[30.6.1] [Overview] [Partial] [-] [-]]
6565
[[30.6.2] [Error handling] [Yes] [-] [-]]
66-
[[30.6.3] [Class future_error] [Yes] [-] [-]]
66+
[[30.6.3] [Class future_error] [Partial] [noexcept] [#7279]]
6767
[[30.6.4] [Shared state] [-] [-] [-]]
68-
[[30.6.5] [Class template promise] [Partial] [allocator] [#6228]]
69-
[[30.6.6] [Class template future] [Partial] [allocator,unique_future is the closest to future, renamed in V3] [#6228]]
70-
[[30.6.7] [Class template shared_future] [Partial] [allocator] [#6228]]
71-
[[30.6.8] [Function template async] [No] [async] [#4710]]
72-
[[30.6.9] [Class template packaged_task] [Partial] [move] [#yyyy]]
68+
[[30.6.5] [Class template promise] [Partial] [at_thread_exit] [#7280]]
69+
[[30.6.6] [Class template future] [Yes] [-] [-]]
70+
[[30.6.7] [Class template shared_future] [Yes] [-] [-]]
71+
[[30.6.8] [Function template async] [Partial] [deferred not implemented and only a copyable functor is allowed yet] [#4710]]
72+
[[30.6.9] [Class template packaged_task] [Partial] [args,make_ready_at_thread_exit] [#7281,#7282]]
7373
]
7474

7575
[/

doc/configuration.qbk

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ When `BOOST_THREAD_VERSION==3` define `BOOST_THREAD_DONT_PROVIDE_GENERIC_SHARED_
4444

4545
[section:shared_upwards Shared Locking Upwards Conversion]
4646

47-
Boost.Threads includes in version 2 the Shared Locking Upwards Conversion as defined in [@http://home.roadrunner.com/~hinnant/bloomington/shared_mutex.html Shared Locking].
47+
Boost.Threads includes in version 3 the Shared Locking Upwards Conversion as defined in [@http://home.roadrunner.com/~hinnant/bloomington/shared_mutex.html Shared Locking].
4848
These conversions need to be used carefully to avoid deadlock or livelock. The user need to define explicitly `BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSION` to get these upwards conversions.
4949

5050
When `BOOST_THREAD_VERSION==2` define `BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSION ` if you want these features.
@@ -201,13 +201,16 @@ Some compilers don't work correctly with some of the added features.
201201
If __SUNPRO_CC < 0x5100 the library defines
202202

203203
* `BOOST_THREAD_DONT_USE_MOVE`
204+
205+
If __SUNPRO_CC < 0x5100 the library defines
206+
204207
* `BOOST_THREAD_DONT_PROVIDE_FUTURE_CTOR_ALLOCATORS`
205208

206209

207210
[endsect]
208211
[section:vacpp VACPP]
209212

210-
If __IBMCPP__ is defined the library defines
213+
If __IBMCPP__ < 1100 the library defines
211214

212215
* `BOOST_THREAD_DONT_USE_CHRONO`
213216

doc/future_ref.qbk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@
6161
class packaged_task;
6262
template <class R> void swap(packaged_task<R>&, packaged_task<R>&) noexcept;
6363

64-
//template <class R, class Alloc>
65-
//struct uses_allocator<packaged_task <R>, Alloc>; // NOT YET IMPLEMENTED
64+
template <class R, class Alloc>
65+
struct uses_allocator<packaged_task <R>, Alloc>;
6666

6767
// template <class F, class... Args>
6868
// future<typename result_of<typename decay<F>::type(typename decay<Args>::type...)>::type>

doc/overview.qbk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ closely follow the proposals presented to the C++ Standards Committee, in partic
2020
[@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2139.html N2139], and
2121
[@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2094.html N2094]
2222

23-
Vicente J. Botet Escriba started in version 2 the adaptation to comply with the accepted Thread C++11 library (Make use of Boost.Chrono and Boost.Move) and the [@http://home.roadrunner.com/~hinnant/bloomington/shared_mutex.html Shared Locking] Howard Hinnant proposal except for the upward conversions.
23+
Vicente J. Botet Escriba started in version 3 the adaptation to comply with the accepted Thread C++11 library (Make use of Boost.Chrono and Boost.Move) and the [@http://home.roadrunner.com/~hinnant/bloomington/shared_mutex.html Shared Locking] Howard Hinnant proposal except for the upward conversions.
2424
Some minor features have been added also as thread attributes, reverse_lock, shared_lock_guard.
2525

2626
In order to use the classes and functions described here, you can

doc/shared_mutex_ref.qbk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ __shared_lockable_concept__.
5858
Multiple concurrent calls to __lock_ref__, __try_lock_ref__, `__try_lock_for()`, `__try_lock_until()`, __timed_lock_ref__, __lock_shared_ref__,
5959
`__try_lock_shared_for()`, `__try_lock_shared_until()`, __try_lock_shared_ref__ and __timed_lock_shared_ref__ are permitted.
6060

61+
Note the the lack of reader-writer priority policies in shared_mutex. This is due to an algorithm credited to Alexander Terekhov which lets the OS decide which thread is the next to get the lock without caring whether a unique lock or shared lock is being sought. This results in a complete lack of reader or writer starvation. It is simply fair.
6162

6263
[endsect]
6364

doc/thread.qbk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
[library Thread
1010
[quickbook 1.5]
11-
[version 3.0.1]
11+
[version 3.1.0]
1212
[authors [Williams, Anthony] [Botet Escriba, Vicente J.]]
1313
[copyright 2007-11 Anthony Williams]
1414
[copyright 2011-12 Vicente J. Botet Escriba]

doc/thread_ref.qbk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ The user can access to some synchronization functions related to the native curr
338338

339339
Of course all the synchronization facilities provided by Boost.Thread are also available on native threads.
340340

341-
The `boost::this_thread` interrupt related functions behave in a degraded mode when called from a thread created using the native interface, i.e. `boost::this_thread::interruption_enabled()` returns false. As consequence the use of `boost::this_thread::disable_interruption` and `boost::this_thread::restore_interruption` will do nothing and calls to `boost::this_thread::interrupt_point()` will be just ignored.
341+
The `boost::this_thread` interrupt related functions behave in a degraded mode when called from a thread created using the native interface, i.e. `boost::this_thread::interruption_enabled()` returns false. As consequence the use of `boost::this_thread::disable_interruption` and `boost::this_thread::restore_interruption` will do nothing and calls to `boost::this_thread::interruption_point()` will be just ignored.
342342

343343
As the single way to interrupt a thread is through a __thread__ instance, `interruption_request()` wiil returns false for the native threads.
344344

@@ -470,8 +470,8 @@ This behavior is incompatible with the current Boost.Thread design, so the use o
470470
[variablelist
471471

472472
[[Effects:] [Transfers ownership of the thread managed by `other` (if
473-
any) to `*this`. Version 1: If there was a thread previously associated with
474-
`*this` then that thread is detached, version 2: If the thread is joinable calls to std::terminate.]]
473+
any) to `*this`. Version 2: If there was a thread previously associated with
474+
`*this` then that thread is detached, version 3: If the thread is joinable calls to std::terminate.]]
475475

476476
[[Postconditions:] [`other->get_id()==thread::id()` and `get_id()` returns the value of `other.get_id()` prior to the assignment.]]
477477

doc/tss.qbk

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ platforms such cleanup is only done for threads that are started with
4747
`boost::thread` unless `boost::on_thread_exit()` is called manually
4848
from that thread.
4949

50+
[heading Rational about the nature of the key]
51+
52+
Boost.Thread uses the address of the `thread_specific_ptr` instance as key of the thread specific pointers. This avoids to create/destroy a key which will need a lock to protect from race conditions. This has a little performance liability, as the access must be done using an associative container.
53+
5054
[section:thread_specific_ptr Class `thread_specific_ptr`]
5155

5256
#include <boost/thread/tss.hpp>
@@ -102,10 +106,14 @@ supplied `cleanup_function` will be used to destroy any thread-local objects whe
102106

103107
[variablelist
104108

109+
[[Requires:] [All the thread specific instances associated to this thread_specific_ptr (except maybe the one associated to this thread) must be null.]]
110+
105111
[[Effects:] [Calls `this->reset()` to clean up the associated value for the current thread, and destroys `*this`.]]
106112

107113
[[Throws:] [Nothing.]]
108114

115+
[[Remarks:] [The requirement is due to the fact that in order to delete all these instances, the implementation should be forced to maintain a list of all the threads having an associated specific ptr, which is against the goal of thread specific data.]]
116+
109117
]
110118

111119
[note Care needs to be taken to ensure that any threads still running after an instance of `boost::thread_specific_ptr` has been

0 commit comments

Comments
 (0)