|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r83660 - in branches/release: boost/thread boost/thread/detail boost/thread/pthread libs/thread libs/thread/doc libs/thread/example libs/thread/test libs/thread/test/sync/futures/future libs/thread/test/sync/mutual_exclusion/locks/shared_lock/cons libs/thread/test/sync/mutual_exclusion/locks/shared_lock_guard libs/thread/test/threads/this_thread/get_id libs/thread/test/threads/this_thread/sleep_for libs/thread/test/threads/this_thread/sleep_until libs/thread/test/threads/thread/assign libs/thread/test/threads/thread/constr libs/thread/test/threads/thread/destr libs/thread/test/threads/thread/id libs/thread/test/threads/thread/members libs/thread/test/threads/thread/non_members libs/thread/test/threads/thread/static
From: vicente.botet_at_[hidden]
Date: 2013-03-31 06:56:52
Author: viboes
Date: 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
New Revision: 83660
URL: http://svn.boost.org/trac/boost/changeset/83660
Log:
Thread: merge from trunk 1.54. Fix #8027,#8323,#8337.
Added:
branches/release/boost/thread/sync_bounded_queue.hpp
- copied, changed from r83647, /trunk/boost/thread/sync_bounded_queue.hpp
branches/release/boost/thread/sync_queue.hpp
- copied, changed from r83647, /trunk/boost/thread/sync_queue.hpp
branches/release/libs/thread/doc/sync_queues_ref.qbk
- copied unchanged from r83654, /trunk/libs/thread/doc/sync_queues_ref.qbk
branches/release/libs/thread/doc/sync_streams.qbk
- copied unchanged from r83654, /trunk/libs/thread/doc/sync_streams.qbk
branches/release/libs/thread/doc/synchronized_value_ref.qbk
- copied unchanged from r83654, /trunk/libs/thread/doc/synchronized_value_ref.qbk
branches/release/libs/thread/example/producer_consumer.cpp
- copied, changed from r83647, /trunk/libs/thread/example/producer_consumer.cpp
branches/release/libs/thread/example/producer_consumer_bounded.cpp
- copied, changed from r83647, /trunk/libs/thread/example/producer_consumer_bounded.cpp
Properties modified:
branches/release/boost/thread/ (props changed)
branches/release/libs/thread/ (props changed)
Text files modified:
branches/release/boost/thread/detail/thread.hpp | 9
branches/release/boost/thread/future.hpp | 92 ++++++++
branches/release/boost/thread/pthread/shared_mutex.hpp | 201 ++++++++++++++++---
branches/release/boost/thread/scoped_thread.hpp | 2
branches/release/boost/thread/sync_bounded_queue.hpp | 84 ++++----
branches/release/boost/thread/sync_queue.hpp | 112 ++++------
branches/release/boost/thread/thread_functors.hpp | 2
branches/release/libs/thread/doc/changes.qbk | 25 +
branches/release/libs/thread/doc/future_ref.qbk | 2
branches/release/libs/thread/doc/internal_locking.qbk | 2
branches/release/libs/thread/doc/mutex_concepts.qbk | 53 +++++
branches/release/libs/thread/doc/mutexes.qbk | 404 ----------------------------------------
branches/release/libs/thread/doc/once.qbk | 8
branches/release/libs/thread/doc/sync_tutorial.qbk | 2
branches/release/libs/thread/doc/synchronized_value.qbk | 13
branches/release/libs/thread/doc/thread.qbk | 12
branches/release/libs/thread/example/condition.cpp | 2
branches/release/libs/thread/example/future_then.cpp | 4
branches/release/libs/thread/example/monitor.cpp | 2
branches/release/libs/thread/example/not_interleaved.cpp | 10
branches/release/libs/thread/example/perf_shared_mutex.cpp | 2
branches/release/libs/thread/example/producer_consumer.cpp | 16
branches/release/libs/thread/example/producer_consumer_bounded.cpp | 16
branches/release/libs/thread/example/shared_monitor.cpp | 2
branches/release/libs/thread/example/shared_mutex.cpp | 2
branches/release/libs/thread/example/starvephil.cpp | 2
branches/release/libs/thread/example/tennis.cpp | 2
branches/release/libs/thread/example/thread.cpp | 2
branches/release/libs/thread/example/thread_guard.cpp | 2
branches/release/libs/thread/example/xtime.cpp | 2
branches/release/libs/thread/test/Jamfile.v2 | 5
branches/release/libs/thread/test/sync/futures/future/then_pass.cpp | 2
branches/release/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/cons/adopt_lock_pass.cpp | 2
branches/release/libs/thread/test/sync/mutual_exclusion/locks/shared_lock_guard/adopt_lock_pass.cpp | 4
branches/release/libs/thread/test/test_2741.cpp | 2
branches/release/libs/thread/test/test_3837.cpp | 1
branches/release/libs/thread/test/test_4521.cpp | 3
branches/release/libs/thread/test/test_4882.cpp | 2
branches/release/libs/thread/test/test_5351.cpp | 2
branches/release/libs/thread/test/test_5502.cpp | 2
branches/release/libs/thread/test/test_5542_1.cpp | 2
branches/release/libs/thread/test/test_5542_2.cpp | 2
branches/release/libs/thread/test/test_5542_3.cpp | 2
branches/release/libs/thread/test/test_5891.cpp | 2
branches/release/libs/thread/test/test_6130.cpp | 2
branches/release/libs/thread/test/test_6174.cpp | 3
branches/release/libs/thread/test/test_7160.cpp | 2
branches/release/libs/thread/test/test_7328.cpp | 2
branches/release/libs/thread/test/test_7571.cpp | 2
branches/release/libs/thread/test/test_7665.cpp | 2
branches/release/libs/thread/test/test_7666.cpp | 2
branches/release/libs/thread/test/test_7720.cpp | 2
branches/release/libs/thread/test/test_7755.cpp | 2
branches/release/libs/thread/test/test_condition.cpp | 2
branches/release/libs/thread/test/test_condition_notify_all.cpp | 2
branches/release/libs/thread/test/test_condition_notify_one.cpp | 2
branches/release/libs/thread/test/test_condition_timed_wait_times_out.cpp | 2
branches/release/libs/thread/test/test_futures.cpp | 2
branches/release/libs/thread/test/test_generic_locks.cpp | 2
branches/release/libs/thread/test/test_hardware_concurrency.cpp | 2
branches/release/libs/thread/test/test_lock_concept.cpp | 17 +
branches/release/libs/thread/test/test_move_function.cpp | 2
branches/release/libs/thread/test/test_mutex.cpp | 2
branches/release/libs/thread/test/test_shared_mutex.cpp | 5
branches/release/libs/thread/test/test_shared_mutex_part_2.cpp | 2
branches/release/libs/thread/test/test_shared_mutex_timed_locks.cpp | 2
branches/release/libs/thread/test/test_thread.cpp | 2
branches/release/libs/thread/test/test_thread_exit.cpp | 2
branches/release/libs/thread/test/test_thread_id.cpp | 2
branches/release/libs/thread/test/test_thread_launching.cpp | 2
branches/release/libs/thread/test/test_thread_mf.cpp | 2
branches/release/libs/thread/test/test_thread_move.cpp | 2
branches/release/libs/thread/test/test_thread_move_return.cpp | 2
branches/release/libs/thread/test/test_thread_return_local.cpp | 2
branches/release/libs/thread/test/threads/this_thread/get_id/get_id_pass.cpp | 2
branches/release/libs/thread/test/threads/this_thread/sleep_for/sleep_for_pass.cpp | 2
branches/release/libs/thread/test/threads/this_thread/sleep_until/sleep_until_pass.cpp | 2
branches/release/libs/thread/test/threads/thread/assign/copy_fail.cpp | 2
branches/release/libs/thread/test/threads/thread/assign/move_pass.cpp | 2
branches/release/libs/thread/test/threads/thread/constr/FArgs_pass.cpp | 2
branches/release/libs/thread/test/threads/thread/constr/F_pass.cpp | 2
branches/release/libs/thread/test/threads/thread/constr/FrvalueArgs_pass.cpp | 2
branches/release/libs/thread/test/threads/thread/constr/Frvalue_pass.cpp | 2
branches/release/libs/thread/test/threads/thread/constr/copy_fail.cpp | 2
branches/release/libs/thread/test/threads/thread/constr/default_pass.cpp | 2
branches/release/libs/thread/test/threads/thread/constr/move_pass.cpp | 2
branches/release/libs/thread/test/threads/thread/destr/dtor_pass.cpp | 2
branches/release/libs/thread/test/threads/thread/id/hash_pass.cpp | 2
branches/release/libs/thread/test/threads/thread/members/detach_pass.cpp | 2
branches/release/libs/thread/test/threads/thread/members/get_id_pass.cpp | 2
branches/release/libs/thread/test/threads/thread/members/join_pass.cpp | 2
branches/release/libs/thread/test/threads/thread/members/joinable_pass.cpp | 2
branches/release/libs/thread/test/threads/thread/members/native_handle_pass.cpp | 4
branches/release/libs/thread/test/threads/thread/members/swap_pass.cpp | 2
branches/release/libs/thread/test/threads/thread/members/try_join_for_pass.cpp | 2
branches/release/libs/thread/test/threads/thread/members/try_join_until_pass.cpp | 2
branches/release/libs/thread/test/threads/thread/non_members/swap_pass.cpp | 2
branches/release/libs/thread/test/threads/thread/static/hardware_concurrency_pass.cpp | 2
98 files changed, 576 insertions(+), 675 deletions(-)
Modified: branches/release/boost/thread/detail/thread.hpp
==============================================================================
--- branches/release/boost/thread/detail/thread.hpp (original)
+++ branches/release/boost/thread/detail/thread.hpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -476,8 +476,13 @@
{
using namespace chrono;
system_clock::time_point s_now = system_clock::now();
- typename Clock::time_point c_now = Clock::now();
- return try_join_until(s_now + ceil<nanoseconds>(t - c_now));
+ bool joined= false;
+ do {
+ typename Clock::duration d = ceil<nanoseconds>(t-Clock::now());
+ if (d <= Clock::duration::zero()) return false; // in case the Clock::time_point t is already reached
+ joined = try_join_until(s_now + d);
+ } while (! joined);
+ return true;
}
template <class Duration>
bool try_join_until(const chrono::time_point<chrono::system_clock, Duration>& t)
Modified: branches/release/boost/thread/future.hpp
==============================================================================
--- branches/release/boost/thread/future.hpp (original)
+++ branches/release/boost/thread/future.hpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -101,11 +101,6 @@
{
return ec_;
}
- const char* what() const BOOST_THREAD_NOEXCEPT_OR_THROW
- {
- return code().message().c_str();
- }
-
};
class BOOST_SYMBOL_VISIBLE future_uninitialized:
@@ -262,6 +257,7 @@
}
void set_async()
{
+ is_deferred_ = false;
set_launch_policy(launch::async);
}
void set_launch_policy(launch policy)
@@ -1380,6 +1376,7 @@
} // detail
BOOST_THREAD_DCL_MOVABLE_BEG(R) detail::basic_future<R> BOOST_THREAD_DCL_MOVABLE_END
+#if (!defined _MSC_VER || _MSC_VER >= 1400) // _MSC_VER == 1400 on MSVC 2005
namespace detail
{
template <class Rp, class Fp>
@@ -1390,6 +1387,7 @@
BOOST_THREAD_FUTURE<Rp>
make_future_deferred_object(BOOST_THREAD_FWD_REF(Fp) f);
}
+#endif // #if (!defined _MSC_VER || _MSC_VER >= 1400)
template <typename R>
class BOOST_THREAD_FUTURE : public detail::basic_future<R>
@@ -1430,7 +1428,7 @@
BOOST_THREAD_MOVABLE_ONLY(BOOST_THREAD_FUTURE)
typedef future_state::state state;
- BOOST_THREAD_FUTURE() {}
+ BOOST_CONSTEXPR BOOST_THREAD_FUTURE() {}
~BOOST_THREAD_FUTURE() {}
@@ -1522,7 +1520,7 @@
typedef future_state::state state;
- shared_future()
+ BOOST_CONSTEXPR shared_future()
{}
~shared_future()
@@ -3255,7 +3253,55 @@
#endif
////////////////////////////////
- // make_shared_future
+ // make_ready_future
+ ////////////////////////////////
+ template <typename T>
+ BOOST_THREAD_FUTURE<typename decay<T>::type> make_ready_future(BOOST_THREAD_FWD_REF(T) value)
+ {
+ typedef typename decay<T>::type future_type;
+ promise<future_type> p;
+ p.set_value(boost::forward<T>(value));
+ return BOOST_THREAD_MAKE_RV_REF(p.get_future());
+ }
+
+#if defined BOOST_THREAD_USES_MOVE
+ inline BOOST_THREAD_FUTURE<void> make_ready_future()
+ {
+ promise<void> p;
+ p.set_value();
+ return BOOST_THREAD_MAKE_RV_REF(p.get_future());
+ }
+#endif
+
+ ////////////////////////////////
+ // make_exceptional_future
+ ////////////////////////////////
+ template <typename T>
+ BOOST_THREAD_FUTURE<T> make_exceptional_future(exception_ptr ex)
+ {
+ promise<T> p;
+ p.set_exception(ex);
+ return BOOST_THREAD_MAKE_RV_REF(p.get_future());
+ }
+
+#if 0
+ template<typename CLOSURE>
+ make_future(CLOSURE closure) -> BOOST_THREAD_FUTURE<decltype(closure())> {
+ typedef decltype(closure() T;
+ promise<T> p;
+ try
+ {
+ p.set_value(closure());
+ }
+ catch(...)
+ {
+ p.set_exception(std::current_exception());
+ }
+ return BOOST_THREAD_MAKE_RV_REF(p.get_future());
+ }
+#endif
+ ////////////////////////////////
+ // make_shared_future deprecated
////////////////////////////////
template <typename T>
shared_future<typename decay<T>::type> make_shared_future(BOOST_THREAD_FWD_REF(T) value)
@@ -3275,6 +3321,36 @@
}
////////////////////////////////
+ // make_ready_shared_future
+ ////////////////////////////////
+ template <typename T>
+ shared_future<typename decay<T>::type> make_ready_shared_future(BOOST_THREAD_FWD_REF(T) value)
+ {
+ typedef typename decay<T>::type future_type;
+ promise<future_type> p;
+ p.set_value(boost::forward<T>(value));
+ return p.get_future().share();
+ }
+
+
+ inline shared_future<void> make_ready_shared_future()
+ {
+ promise<void> p;
+ return BOOST_THREAD_MAKE_RV_REF(p.get_future().share());
+
+ }
+
+ ////////////////////////////////
+ // make_exceptional_shared_future
+ ////////////////////////////////
+ template <typename T>
+ shared_future<T> make_exceptional_shared_future(exception_ptr ex)
+ {
+ promise<T> p;
+ p.set_exception(ex);
+ return p.get_future().share();
+ }
+ ////////////////////////////////
// detail::future_continuation
////////////////////////////////
#if defined BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION
Modified: branches/release/boost/thread/pthread/shared_mutex.hpp
==============================================================================
--- branches/release/boost/thread/pthread/shared_mutex.hpp (original)
+++ branches/release/boost/thread/pthread/shared_mutex.hpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -20,6 +20,7 @@
#include <boost/chrono/ceil.hpp>
#endif
#include <boost/thread/detail/delete.hpp>
+#include <boost/assert.hpp>
#include <boost/config/abi_prefix.hpp>
@@ -28,8 +29,125 @@
class shared_mutex
{
private:
- struct state_data
+ class state_data
{
+ public:
+ state_data () :
+ shared_count(0),
+ exclusive(false),
+ upgrade(false),
+ exclusive_waiting_blocked(false)
+ {}
+
+ void assert_free() const
+ {
+ BOOST_ASSERT( ! exclusive );
+ BOOST_ASSERT( ! upgrade );
+ BOOST_ASSERT( shared_count==0 );
+ }
+
+ void assert_locked() const
+ {
+ BOOST_ASSERT( exclusive );
+ BOOST_ASSERT( shared_count==0 );
+ BOOST_ASSERT( ! upgrade );
+ }
+
+ void assert_lock_shared () const
+ {
+ BOOST_ASSERT( ! exclusive );
+ BOOST_ASSERT( shared_count>0 );
+ //BOOST_ASSERT( (! upgrade) || (shared_count>1));
+ // if upgraded there are at least 2 threads sharing the mutex,
+ // except when unlock_upgrade_and_lock has decreased the number of readers but has not taken yet exclusive ownership.
+ }
+
+ void assert_lock_upgraded () const
+ {
+ BOOST_ASSERT( ! exclusive );
+ BOOST_ASSERT( upgrade );
+ BOOST_ASSERT( shared_count>0 );
+ }
+
+ void assert_lock_not_upgraded () const
+ {
+ BOOST_ASSERT( ! upgrade );
+ }
+
+ bool can_lock () const
+ {
+ return ! (shared_count || exclusive);
+ }
+
+ void exclusive_blocked (bool blocked)
+ {
+ exclusive_waiting_blocked = blocked;
+ }
+
+ void lock ()
+ {
+ exclusive = true;
+ }
+
+ void unlock ()
+ {
+ exclusive = false;
+ exclusive_waiting_blocked = false;
+ }
+
+ bool can_lock_shared () const
+ {
+ return ! (exclusive || exclusive_waiting_blocked);
+ }
+
+ bool more_shared () const
+ {
+ return shared_count > 0 ;
+ }
+ unsigned get_shared_count () const
+ {
+ return shared_count ;
+ }
+ unsigned lock_shared ()
+ {
+ return ++shared_count;
+ }
+
+
+ void unlock_shared ()
+ {
+ --shared_count;
+ }
+
+ bool unlock_shared_downgrades()
+ {
+ if (upgrade) {
+ upgrade=false;
+ exclusive=true;
+ return true;
+ } else {
+ exclusive_waiting_blocked=false;
+ return false;
+ }
+ }
+
+ void lock_upgrade ()
+ {
+ ++shared_count;
+ upgrade=true;
+ }
+ bool can_lock_upgrade () const
+ {
+ return ! (exclusive || exclusive_waiting_blocked || upgrade);
+ }
+
+ void unlock_upgrade ()
+ {
+ upgrade=false;
+ --shared_count;
+ }
+
+ //private:
unsigned shared_count;
bool exclusive;
bool upgrade;
@@ -51,12 +169,11 @@
}
public:
+
BOOST_THREAD_NO_COPYABLE(shared_mutex)
shared_mutex()
{
- state_data state_={0,0,0,0};
- state=state_;
}
~shared_mutex()
@@ -69,27 +186,23 @@
boost::this_thread::disable_interruption do_not_disturb;
#endif
boost::unique_lock<boost::mutex> lk(state_change);
-
- while(state.exclusive || state.exclusive_waiting_blocked)
+ while(!state.can_lock_shared())
{
shared_cond.wait(lk);
}
- ++state.shared_count;
+ state.lock_shared();
}
bool try_lock_shared()
{
boost::unique_lock<boost::mutex> lk(state_change);
- if(state.exclusive || state.exclusive_waiting_blocked)
+ if(!state.can_lock_shared())
{
return false;
}
- else
- {
- ++state.shared_count;
- return true;
- }
+ state.lock_shared();
+ return true;
}
#if defined BOOST_THREAD_USES_DATETIME
@@ -100,14 +213,14 @@
#endif
boost::unique_lock<boost::mutex> lk(state_change);
- while(state.exclusive || state.exclusive_waiting_blocked)
+ while(!state.can_lock_shared())
{
if(!shared_cond.timed_wait(lk,timeout))
{
return false;
}
}
- ++state.shared_count;
+ state.lock_shared();
return true;
}
@@ -131,33 +244,38 @@
#endif
boost::unique_lock<boost::mutex> lk(state_change);
- while(state.exclusive || state.exclusive_waiting_blocked)
+ while(!state.can_lock_shared())
+ //while(state.exclusive || state.exclusive_waiting_blocked)
{
if(cv_status::timeout==shared_cond.wait_until(lk,abs_time))
{
return false;
}
}
- ++state.shared_count;
+ state.lock_shared();
return true;
}
#endif
void unlock_shared()
{
boost::unique_lock<boost::mutex> lk(state_change);
- bool const last_reader=!--state.shared_count;
-
- if(last_reader)
+ state.assert_lock_shared();
+ state.unlock_shared();
+ if (! state.more_shared())
{
- if(state.upgrade)
+ if (state.upgrade)
{
+ // As there is a thread doing a unlock_upgrade_and_lock that is waiting for ! state.more_shared()
+ // avoid other threads to lock, lock_upgrade or lock_shared, so only this thread is notified.
state.upgrade=false;
state.exclusive=true;
+ lk.unlock();
upgrade_cond.notify_one();
}
else
{
state.exclusive_waiting_blocked=false;
+ lk.unlock();
}
release_waiters();
}
@@ -170,7 +288,7 @@
#endif
boost::unique_lock<boost::mutex> lk(state_change);
- while(state.shared_count || state.exclusive)
+ while (state.shared_count || state.exclusive)
{
state.exclusive_waiting_blocked=true;
exclusive_cond.wait(lk);
@@ -262,8 +380,10 @@
void unlock()
{
boost::unique_lock<boost::mutex> lk(state_change);
+ state.assert_locked();
state.exclusive=false;
state.exclusive_waiting_blocked=false;
+ state.assert_free();
release_waiters();
}
@@ -277,7 +397,7 @@
{
shared_cond.wait(lk);
}
- ++state.shared_count;
+ state.lock_shared();
state.upgrade=true;
}
@@ -299,7 +419,7 @@
break;
}
}
- ++state.shared_count;
+ state.lock_shared();
state.upgrade=true;
return true;
}
@@ -334,7 +454,7 @@
break;
}
}
- ++state.shared_count;
+ state.lock_shared();
state.upgrade=true;
return true;
}
@@ -348,8 +468,9 @@
}
else
{
- ++state.shared_count;
+ state.lock_shared();
state.upgrade=true;
+ state.assert_lock_upgraded();
return true;
}
}
@@ -357,15 +478,14 @@
void unlock_upgrade()
{
boost::unique_lock<boost::mutex> lk(state_change);
- state.upgrade=false;
- bool const last_reader=!--state.shared_count;
-
- if(last_reader)
+ //state.upgrade=false;
+ state.unlock_upgrade();
+ if(! state.more_shared() )
{
state.exclusive_waiting_blocked=false;
release_waiters();
} else {
- shared_cond.notify_all();
+ shared_cond.notify_all();
}
}
@@ -376,28 +496,33 @@
boost::this_thread::disable_interruption do_not_disturb;
#endif
boost::unique_lock<boost::mutex> lk(state_change);
- --state.shared_count;
- while(state.shared_count)
+ state.assert_lock_upgraded();
+ state.unlock_shared();
+ while (state.more_shared())
{
upgrade_cond.wait(lk);
}
state.upgrade=false;
state.exclusive=true;
+ state.assert_locked();
}
void unlock_and_lock_upgrade()
{
boost::unique_lock<boost::mutex> lk(state_change);
+ state.assert_locked();
state.exclusive=false;
state.upgrade=true;
- ++state.shared_count;
+ state.lock_shared();
state.exclusive_waiting_blocked=false;
+ state.assert_lock_upgraded();
release_waiters();
}
bool try_unlock_upgrade_and_lock()
{
boost::unique_lock<boost::mutex> lk(state_change);
+ state.assert_lock_upgraded();
if( !state.exclusive
&& !state.exclusive_waiting_blocked
&& state.upgrade
@@ -406,6 +531,7 @@
state.shared_count=0;
state.exclusive=true;
state.upgrade=false;
+ state.assert_locked();
return true;
}
return false;
@@ -428,6 +554,7 @@
boost::this_thread::disable_interruption do_not_disturb;
#endif
boost::unique_lock<boost::mutex> lk(state_change);
+ state.assert_lock_upgraded();
if (state.shared_count != 1)
{
for (;;)
@@ -451,8 +578,9 @@
void unlock_and_lock_shared()
{
boost::unique_lock<boost::mutex> lk(state_change);
+ state.assert_locked();
state.exclusive=false;
- ++state.shared_count;
+ state.lock_shared();
state.exclusive_waiting_blocked=false;
release_waiters();
}
@@ -461,6 +589,7 @@
bool try_unlock_shared_and_lock()
{
boost::unique_lock<boost::mutex> lk(state_change);
+ state.assert_lock_shared();
if( !state.exclusive
&& !state.exclusive_waiting_blocked
&& !state.upgrade
@@ -490,6 +619,7 @@
boost::this_thread::disable_interruption do_not_disturb;
#endif
boost::unique_lock<boost::mutex> lk(state_change);
+ state.assert_lock_shared();
if (state.shared_count != 1)
{
for (;;)
@@ -514,6 +644,7 @@
void unlock_upgrade_and_lock_shared()
{
boost::unique_lock<boost::mutex> lk(state_change);
+ state.assert_lock_upgraded();
state.upgrade=false;
state.exclusive_waiting_blocked=false;
release_waiters();
@@ -523,6 +654,7 @@
bool try_unlock_shared_and_lock_upgrade()
{
boost::unique_lock<boost::mutex> lk(state_change);
+ state.assert_lock_shared();
if( !state.exclusive
&& !state.exclusive_waiting_blocked
&& !state.upgrade
@@ -551,6 +683,7 @@
boost::this_thread::disable_interruption do_not_disturb;
#endif
boost::unique_lock<boost::mutex> lk(state_change);
+ state.assert_lock_shared();
if( state.exclusive
|| state.exclusive_waiting_blocked
|| state.upgrade
Modified: branches/release/boost/thread/scoped_thread.hpp
==============================================================================
--- branches/release/boost/thread/scoped_thread.hpp (original)
+++ branches/release/boost/thread/scoped_thread.hpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -13,7 +13,7 @@
#include <boost/thread/detail/delete.hpp>
#include <boost/thread/detail/move.hpp>
#include <boost/thread/thread_functors.hpp>
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <boost/config/abi_prefix.hpp>
Copied: branches/release/boost/thread/sync_bounded_queue.hpp (from r83647, /trunk/boost/thread/sync_bounded_queue.hpp)
==============================================================================
--- /trunk/boost/thread/sync_bounded_queue.hpp (original)
+++ branches/release/boost/thread/sync_bounded_queue.hpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -40,9 +40,8 @@
typedef ValueType value_type;
typedef std::size_t size_type;
-
+ // Constructors/Assignment/Destructors
BOOST_THREAD_NO_COPYABLE(sync_bounded_queue)
-
explicit sync_bounded_queue(size_type max_elems);
template <typename Range>
sync_bounded_queue(size_type max_elems, Range range);
@@ -56,25 +55,24 @@
bool closed() const;
// Modifiers
- void wait_and_push(const value_type& x);
- void wait_and_push(BOOST_THREAD_RV_REF(value_type) x);
+ void close();
+
+ void push(const value_type& x);
+ void push(BOOST_THREAD_RV_REF(value_type) x);
bool try_push(const value_type& x);
bool try_push(BOOST_THREAD_RV_REF(value_type) x);
bool try_push(no_block_tag, const value_type& x);
bool try_push(no_block_tag, BOOST_THREAD_RV_REF(value_type) x);
- void wait_and_pop(value_type&);
- void wait_and_pop(ValueType& elem, bool & closed);
-
- // enable_if is_nothrow_movable<value_type>
- value_type value_pop();
- shared_ptr<ValueType> wait_and_pop();
-
- bool try_pop(value_type&);
- bool try_pop(no_block_tag,value_type&);
- shared_ptr<ValueType> try_pop();
-
- void close();
+ // Observers/Modifiers
+ void pull(value_type&);
+ void pull(ValueType& elem, bool & closed);
+ // enable_if is_nothrow_copy_movable<value_type>
+ value_type pull();
+ shared_ptr<ValueType> ptr_pull();
+ bool try_pull(value_type&);
+ bool try_pull(no_block_tag,value_type&);
+ shared_ptr<ValueType> try_pull();
private:
mutable mutex mtx_;
@@ -112,10 +110,10 @@
void throw_if_closed(unique_lock<mutex>&);
- bool try_pop(value_type& x, unique_lock<mutex>& lk);
+ bool try_pull(value_type& x, unique_lock<mutex>& lk);
bool try_push(const value_type& x, unique_lock<mutex>& lk);
bool try_push(BOOST_THREAD_RV_REF(value_type) x, unique_lock<mutex>& lk);
- shared_ptr<value_type> try_pop(unique_lock<mutex>& lk);
+ shared_ptr<value_type> try_pull(unique_lock<mutex>& lk);
void wait_until_not_empty(unique_lock<mutex>& lk);
void wait_until_not_empty(unique_lock<mutex>& lk, bool&);
@@ -142,13 +140,13 @@
}
}
- void pop(value_type& elem, unique_lock<mutex>& lk)
+ void pull(value_type& elem, unique_lock<mutex>& lk)
{
elem = boost::move(data_[out_]);
out_ = inc(out_);
notify_not_full_if_needed(lk);
}
- boost::shared_ptr<value_type> pop(unique_lock<mutex>& lk)
+ boost::shared_ptr<value_type> ptr_pull(unique_lock<mutex>& lk)
{
shared_ptr<value_type> res = make_shared<value_type>(boost::move(data_[out_]));
out_ = inc(out_);
@@ -265,34 +263,34 @@
template <typename ValueType>
- bool sync_bounded_queue<ValueType>::try_pop(ValueType& elem, unique_lock<mutex>& lk)
+ bool sync_bounded_queue<ValueType>::try_pull(ValueType& elem, unique_lock<mutex>& lk)
{
if (empty(lk))
{
throw_if_closed(lk);
return false;
}
- pop(elem, lk);
+ pull(elem, lk);
return true;
}
template <typename ValueType>
- shared_ptr<ValueType> sync_bounded_queue<ValueType>::try_pop(unique_lock<mutex>& lk)
+ shared_ptr<ValueType> sync_bounded_queue<ValueType>::try_pull(unique_lock<mutex>& lk)
{
if (empty(lk))
{
throw_if_closed(lk);
return shared_ptr<ValueType>();
}
- return pop(lk);
+ return ptr_pull(lk);
}
template <typename ValueType>
- bool sync_bounded_queue<ValueType>::try_pop(ValueType& elem)
+ bool sync_bounded_queue<ValueType>::try_pull(ValueType& elem)
{
try
{
unique_lock<mutex> lk(mtx_);
- return try_pop(elem, lk);
+ return try_pull(elem, lk);
}
catch (...)
{
@@ -302,7 +300,7 @@
}
template <typename ValueType>
- bool sync_bounded_queue<ValueType>::try_pop(no_block_tag,ValueType& elem)
+ bool sync_bounded_queue<ValueType>::try_pull(no_block_tag,ValueType& elem)
{
try
{
@@ -311,7 +309,7 @@
{
return false;
}
- return try_pop(elem, lk);
+ return try_pull(elem, lk);
}
catch (...)
{
@@ -320,12 +318,12 @@
}
}
template <typename ValueType>
- boost::shared_ptr<ValueType> sync_bounded_queue<ValueType>::try_pop()
+ boost::shared_ptr<ValueType> sync_bounded_queue<ValueType>::try_pull()
{
try
{
unique_lock<mutex> lk(mtx_);
- return try_pop(lk);
+ return try_pull(lk);
}
catch (...)
{
@@ -367,13 +365,13 @@
}
template <typename ValueType>
- void sync_bounded_queue<ValueType>::wait_and_pop(ValueType& elem)
+ void sync_bounded_queue<ValueType>::pull(ValueType& elem)
{
try
{
unique_lock<mutex> lk(mtx_);
wait_until_not_empty(lk);
- pop(elem, lk);
+ pull(elem, lk);
}
catch (...)
{
@@ -382,14 +380,14 @@
}
}
template <typename ValueType>
- void sync_bounded_queue<ValueType>::wait_and_pop(ValueType& elem, bool & closed)
+ void sync_bounded_queue<ValueType>::pull(ValueType& elem, bool & closed)
{
try
{
unique_lock<mutex> lk(mtx_);
wait_until_not_empty(lk, closed);
if (closed) {return;}
- pop(elem, lk);
+ pull(elem, lk);
}
catch (...)
{
@@ -400,12 +398,12 @@
// enable if ValueType is nothrow movable
template <typename ValueType>
- ValueType sync_bounded_queue<ValueType>::value_pop()
+ ValueType sync_bounded_queue<ValueType>::pull()
{
try
{
value_type elem;
- wait_and_pop(elem);
+ pull(elem);
return boost::move(elem);
}
catch (...)
@@ -415,13 +413,13 @@
}
}
template <typename ValueType>
- boost::shared_ptr<ValueType> sync_bounded_queue<ValueType>::wait_and_pop()
+ boost::shared_ptr<ValueType> sync_bounded_queue<ValueType>::ptr_pull()
{
try
{
unique_lock<mutex> lk(mtx_);
wait_until_not_empty(lk);
- return pop(lk);
+ return ptr_pull(lk);
}
catch (...)
{
@@ -492,7 +490,7 @@
}
template <typename ValueType>
- void sync_bounded_queue<ValueType>::wait_and_push(const ValueType& elem)
+ void sync_bounded_queue<ValueType>::push(const ValueType& elem)
{
try
{
@@ -554,7 +552,7 @@
}
template <typename ValueType>
- void sync_bounded_queue<ValueType>::wait_and_push(BOOST_THREAD_RV_REF(ValueType) elem)
+ void sync_bounded_queue<ValueType>::push(BOOST_THREAD_RV_REF(ValueType) elem)
{
try
{
@@ -571,21 +569,21 @@
template <typename ValueType>
sync_bounded_queue<ValueType>& operator<<(sync_bounded_queue<ValueType>& sbq, BOOST_THREAD_RV_REF(ValueType) elem)
{
- sbq.wait_and_push(boost::forward<ValueType>(elem));
+ sbq.push(boost::forward<ValueType>(elem));
return sbq;
}
template <typename ValueType>
sync_bounded_queue<ValueType>& operator<<(sync_bounded_queue<ValueType>& sbq, ValueType const&elem)
{
- sbq.wait_and_push(elem);
+ sbq.push(elem);
return sbq;
}
template <typename ValueType>
sync_bounded_queue<ValueType>& operator>>(sync_bounded_queue<ValueType>& sbq, ValueType &elem)
{
- sbq.wait_and_pop(elem);
+ sbq.pull(elem);
return sbq;
}
Copied: branches/release/boost/thread/sync_queue.hpp (from r83647, /trunk/boost/thread/sync_queue.hpp)
==============================================================================
--- /trunk/boost/thread/sync_queue.hpp (original)
+++ branches/release/boost/thread/sync_queue.hpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -35,12 +35,11 @@
typedef ValueType value_type;
typedef std::size_t size_type;
-
+ // Constructors/Assignment/Destructors
BOOST_THREAD_NO_COPYABLE(sync_queue)
-
- explicit sync_queue();
+ sync_queue();
template <typename Range>
- sync_queue(Range range);
+ explicit sync_queue(Range range);
~sync_queue();
// Observers
@@ -50,25 +49,25 @@
bool closed() const;
// Modifiers
- void wait_and_push(const value_type& x);
- void wait_and_push(BOOST_THREAD_RV_REF(value_type) x);
+ void close();
+
+ void push(const value_type& x);
+ void push(BOOST_THREAD_RV_REF(value_type) x);
bool try_push(const value_type& x);
bool try_push(BOOST_THREAD_RV_REF(value_type) x);
bool try_push(no_block_tag, const value_type& x);
bool try_push(no_block_tag, BOOST_THREAD_RV_REF(value_type) x);
- void wait_and_pop(value_type&);
- void wait_and_pop(ValueType& elem, bool & closed);
+ // Observers/Modifiers
+ void pull(value_type&);
+ void pull(ValueType& elem, bool & closed);
+ // enable_if is_nothrow_copy_movable<value_type>
+ value_type pull();
+ shared_ptr<ValueType> ptr_pull();
+ bool try_pull(value_type&);
+ bool try_pull(no_block_tag,value_type&);
+ shared_ptr<ValueType> try_pull();
- // enable_if is_nothrow_movable<value_type>
- value_type value_pop();
- shared_ptr<ValueType> wait_and_pop();
-
- bool try_pop(value_type&);
- bool try_pop(no_block_tag,value_type&);
- shared_ptr<ValueType> try_pop();
-
- void close();
private:
mutable mutex mtx_;
@@ -77,15 +76,12 @@
boost::container::deque<ValueType> data_;
bool closed_;
-
bool empty(unique_lock<mutex>& ) const BOOST_NOEXCEPT
{
- //std::cout << __LINE__ << std::endl;
return data_.empty();
}
bool empty(lock_guard<mutex>& ) const BOOST_NOEXCEPT
{
- //std::cout << __LINE__ << std::endl;
return data_.empty();
}
@@ -96,10 +92,10 @@
void throw_if_closed(unique_lock<mutex>&);
- bool try_pop(value_type& x, unique_lock<mutex>& lk);
+ bool try_pull(value_type& x, unique_lock<mutex>& lk);
bool try_push(const value_type& x, unique_lock<mutex>& lk);
bool try_push(BOOST_THREAD_RV_REF(value_type) x, unique_lock<mutex>& lk);
- shared_ptr<value_type> try_pop(unique_lock<mutex>& lk);
+ shared_ptr<value_type> try_pull(unique_lock<mutex>& lk);
void wait_until_not_empty(unique_lock<mutex>& lk);
void wait_until_not_empty(unique_lock<mutex>& lk, bool&);
@@ -115,25 +111,25 @@
}
}
- void pop(value_type& elem, unique_lock<mutex>& )
+ void pull(value_type& elem, unique_lock<mutex>& )
{
elem = boost::move(data_.front());
data_.pop_front();
}
- boost::shared_ptr<value_type> pop(unique_lock<mutex>& )
+ boost::shared_ptr<value_type> ptr_pull(unique_lock<mutex>& )
{
shared_ptr<value_type> res = make_shared<value_type>(boost::move(data_.front()));
data_.pop_front();
return res;
}
- void push_at(const value_type& elem, unique_lock<mutex>& lk)
+ void push(const value_type& elem, unique_lock<mutex>& lk)
{
data_.push_back(elem);
notify_not_empty_if_needed(lk);
}
- void push_at(BOOST_THREAD_RV_REF(value_type) elem, unique_lock<mutex>& lk)
+ void push(BOOST_THREAD_RV_REF(value_type) elem, unique_lock<mutex>& lk)
{
data_.push(boost::move(elem));
notify_not_empty_if_needed(lk);
@@ -151,7 +147,7 @@
// template <typename ValueType>
// template <typename Range>
-// sync_queue<ValueType>::sync_queue(size_type max_elems, Range range) :
+// explicit sync_queue<ValueType>::sync_queue(Range range) :
// waiting_empty_(0), data_(), closed_(false)
// {
// try
@@ -214,34 +210,34 @@
template <typename ValueType>
- bool sync_queue<ValueType>::try_pop(ValueType& elem, unique_lock<mutex>& lk)
+ bool sync_queue<ValueType>::try_pull(ValueType& elem, unique_lock<mutex>& lk)
{
if (empty(lk))
{
throw_if_closed(lk);
return false;
}
- pop(elem, lk);
+ pull(elem, lk);
return true;
}
template <typename ValueType>
- shared_ptr<ValueType> sync_queue<ValueType>::try_pop(unique_lock<mutex>& lk)
+ shared_ptr<ValueType> sync_queue<ValueType>::try_pull(unique_lock<mutex>& lk)
{
if (empty(lk))
{
throw_if_closed(lk);
return shared_ptr<ValueType>();
}
- return pop(lk);
+ return ptr_pull(lk);
}
template <typename ValueType>
- bool sync_queue<ValueType>::try_pop(ValueType& elem)
+ bool sync_queue<ValueType>::try_pull(ValueType& elem)
{
try
{
unique_lock<mutex> lk(mtx_);
- return try_pop(elem, lk);
+ return try_pull(elem, lk);
}
catch (...)
{
@@ -251,7 +247,7 @@
}
template <typename ValueType>
- bool sync_queue<ValueType>::try_pop(no_block_tag,ValueType& elem)
+ bool sync_queue<ValueType>::try_pull(no_block_tag,ValueType& elem)
{
try
{
@@ -260,7 +256,7 @@
{
return false;
}
- return try_pop(elem, lk);
+ return try_pull(elem, lk);
}
catch (...)
{
@@ -269,12 +265,12 @@
}
}
template <typename ValueType>
- boost::shared_ptr<ValueType> sync_queue<ValueType>::try_pop()
+ boost::shared_ptr<ValueType> sync_queue<ValueType>::try_pull()
{
try
{
unique_lock<mutex> lk(mtx_);
- return try_pop(lk);
+ return try_pull(lk);
}
catch (...)
{
@@ -286,10 +282,8 @@
template <typename ValueType>
void sync_queue<ValueType>::throw_if_closed(unique_lock<mutex>&)
{
- //std::cout << __LINE__ << std::endl;
if (closed_)
{
- std::cout << __LINE__ << std::endl;
BOOST_THROW_EXCEPTION( sync_queue_is_closed() );
}
}
@@ -299,10 +293,7 @@
{
for (;;)
{
- //std::cout << __LINE__ << std::endl;
if (! empty(lk)) break;
- //std::cout << __LINE__ << std::endl;
-
throw_if_closed(lk);
++waiting_empty_;
not_empty_.wait(lk);
@@ -314,7 +305,6 @@
for (;;)
{
if (! empty(lk)) break;
- //std::cout << __LINE__ << std::endl;
if (closed_) {closed=true; return;}
++waiting_empty_;
not_empty_.wait(lk);
@@ -322,14 +312,13 @@
}
template <typename ValueType>
- void sync_queue<ValueType>::wait_and_pop(ValueType& elem)
+ void sync_queue<ValueType>::pull(ValueType& elem)
{
try
{
unique_lock<mutex> lk(mtx_);
- //std::cout << __LINE__ << std::endl;
wait_until_not_empty(lk);
- pop(elem, lk);
+ pull(elem, lk);
}
catch (...)
{
@@ -338,15 +327,14 @@
}
}
template <typename ValueType>
- void sync_queue<ValueType>::wait_and_pop(ValueType& elem, bool & closed)
+ void sync_queue<ValueType>::pull(ValueType& elem, bool & closed)
{
try
{
unique_lock<mutex> lk(mtx_);
- //std::cout << __LINE__ << std::endl;
wait_until_not_empty(lk, closed);
if (closed) {return;}
- pop(elem, lk);
+ pull(elem, lk);
}
catch (...)
{
@@ -357,12 +345,12 @@
// enable if ValueType is nothrow movable
template <typename ValueType>
- ValueType sync_queue<ValueType>::value_pop()
+ ValueType sync_queue<ValueType>::pull()
{
try
{
value_type elem;
- wait_and_pop(elem);
+ pull(elem);
return boost::move(elem);
}
catch (...)
@@ -372,13 +360,13 @@
}
}
template <typename ValueType>
- boost::shared_ptr<ValueType> sync_queue<ValueType>::wait_and_pop()
+ boost::shared_ptr<ValueType> sync_queue<ValueType>::ptr_pull()
{
try
{
unique_lock<mutex> lk(mtx_);
wait_until_not_empty(lk);
- return pop(lk);
+ return ptr_pull(lk);
}
catch (...)
{
@@ -391,7 +379,7 @@
bool sync_queue<ValueType>::try_push(const ValueType& elem, unique_lock<mutex>& lk)
{
throw_if_closed(lk);
- push_at(elem, lk);
+ push(elem, lk);
return true;
}
@@ -427,13 +415,13 @@
}
template <typename ValueType>
- void sync_queue<ValueType>::wait_and_push(const ValueType& elem)
+ void sync_queue<ValueType>::push(const ValueType& elem)
{
try
{
unique_lock<mutex> lk(mtx_);
throw_if_closed(lk);
- push_at(elem, lk);
+ push(elem, lk);
}
catch (...)
{
@@ -446,7 +434,7 @@
bool sync_queue<ValueType>::try_push(BOOST_THREAD_RV_REF(ValueType) elem, unique_lock<mutex>& lk)
{
throw_if_closed(lk);
- push_at(boost::forward<ValueType>(elem), lk);
+ push(boost::forward<ValueType>(elem), lk);
return true;
}
@@ -485,13 +473,13 @@
}
template <typename ValueType>
- void sync_queue<ValueType>::wait_and_push(BOOST_THREAD_RV_REF(ValueType) elem)
+ void sync_queue<ValueType>::push(BOOST_THREAD_RV_REF(ValueType) elem)
{
try
{
unique_lock<mutex> lk(mtx_);
throw_if_closed(lk);
- push_at(elem, lk);
+ push(elem, lk);
}
catch (...)
{
@@ -503,21 +491,21 @@
template <typename ValueType>
sync_queue<ValueType>& operator<<(sync_queue<ValueType>& sbq, BOOST_THREAD_RV_REF(ValueType) elem)
{
- sbq.wait_and_push(boost::forward<ValueType>(elem));
+ sbq.push(boost::forward<ValueType>(elem));
return sbq;
}
template <typename ValueType>
sync_queue<ValueType>& operator<<(sync_queue<ValueType>& sbq, ValueType const&elem)
{
- sbq.wait_and_push(elem);
+ sbq.push(elem);
return sbq;
}
template <typename ValueType>
sync_queue<ValueType>& operator>>(sync_queue<ValueType>& sbq, ValueType &elem)
{
- sbq.wait_and_pop(elem);
+ sbq.pull(elem);
return sbq;
}
Modified: branches/release/boost/thread/thread_functors.hpp
==============================================================================
--- branches/release/boost/thread/thread_functors.hpp (original)
+++ branches/release/boost/thread/thread_functors.hpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -12,7 +12,7 @@
#include <boost/thread/detail/config.hpp>
#include <boost/thread/detail/delete.hpp>
#include <boost/thread/detail/move.hpp>
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <boost/config/abi_prefix.hpp>
Modified: branches/release/libs/thread/doc/changes.qbk
==============================================================================
--- branches/release/libs/thread/doc/changes.qbk (original)
+++ branches/release/libs/thread/doc/changes.qbk 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -8,27 +8,42 @@
[section:changes History]
+[/
+[heading Version 4.2.0 - boost 1.55]
+
+[*New Features:]
+
+* [@http://svn.boost.org/trac/boost/ticket/8273 #8273] Add externally locked streams
+* [@http://svn.boost.org/trac/boost/ticket/8274 #8274] Add concurrent queue
+
+[*Fixed Bugs:]
+
+]
+
[heading Version 4.1.0 - boost 1.54]
+[*New Features:]
+
* [@http://svn.boost.org/trac/boost/ticket/7285 #7285] C++11 compliance: Allow to pass movable arguments for call_once.
* [@http://svn.boost.org/trac/boost/ticket/7449 #7449] Synchro: Add a synchronized value class
-[heading Version 4.0.0 - boost 1.53]
+[*Fixed Bugs:]
* [@http://svn.boost.org/trac/boost/ticket/4882 #4882] Win32 shared_mutex does not handle timeouts correctly.
* [@http://svn.boost.org/trac/boost/ticket/6652 #6652] Boost.Thread shared_mutex.hpp:50:99: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
* [@http://svn.boost.org/trac/boost/ticket/7720 #7720] exception lock_error while intensive locking/unlocking of mutex
* [@http://svn.boost.org/trac/boost/ticket/7755 #7755] Thread: deadlock with shared_mutex on Windows
-* [@http://svn.boost.org/trac/boost/ticket/4882 #8070] prefer GetTickCount64 over GetTickCount
+* [@http://svn.boost.org/trac/boost/ticket/8027 #8027] thread library fails to compile with Visual Studio 2003
+* [@http://svn.boost.org/trac/boost/ticket/8070 #8070] prefer GetTickCount64 over GetTickCount
* [@http://svn.boost.org/trac/boost/ticket/8136 #8136] boost::this_thread::sleep_for() sleeps longer than it should in Windows
* [@http://svn.boost.org/trac/boost/ticket/8212 #8212] Boost thread compilation error on Solaris 10
* [@http://svn.boost.org/trac/boost/ticket/8237 #8237] fix documentation for 'thread_group'
* [@http://svn.boost.org/trac/boost/ticket/8239 #8239] barrier::wait() not marked as interruption_point
+* [@http://svn.boost.org/trac/boost/ticket/8323 #8323] boost::thread::try_join_for/try_join_until may block indefinitely due to a combination of problems in Boost.Thread and Boost.Chrono
+* [@http://svn.boost.org/trac/boost/ticket/8337 #8337] The internal representation of "std::string(this->code()->message())" escapes, but is destroyed when it exits scope.
-[*New Features:]
-
-[*Fixed Bugs:]
+[heading Version 4.0.0 - boost 1.53]
[/
[*Breaking changes:]
Modified: branches/release/libs/thread/doc/future_ref.qbk
==============================================================================
--- branches/release/libs/thread/doc/future_ref.qbk (original)
+++ branches/release/libs/thread/doc/future_ref.qbk 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -1621,7 +1621,7 @@
[warning `async(launch::deferred, F)` is NOT YET IMPLEMENTED!]
-[warning the variadic prototype is provided only on C++11 compilers supporting rvalue references, variadic templates, decltype and a standard library providing <tuple>, and BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK is defined.]
+[warning the variadic prototype is provided only on C++11 compilers supporting rvalue references, variadic templates, decltype and a standard library providing <tuple> (waiting for a boost::tuple that is move aware), and BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK is defined.]
[heading Non-Variadic variant]
Modified: branches/release/libs/thread/doc/internal_locking.qbk
==============================================================================
--- branches/release/libs/thread/doc/internal_locking.qbk (original)
+++ branches/release/libs/thread/doc/internal_locking.qbk 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -78,7 +78,7 @@
mtx_.lock();
int b = balance_;
mtx_.unlock();
- return balance_;
+ return b;
}
};
Modified: branches/release/libs/thread/doc/mutex_concepts.qbk
==============================================================================
--- branches/release/libs/thread/doc/mutex_concepts.qbk (original)
+++ branches/release/libs/thread/doc/mutex_concepts.qbk 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -42,6 +42,8 @@
[variablelist
+[[Requires:] [The calling thread doesn't owns the mutex if the mutex is not recursive.]]
+
[[Effects:] [The current thread blocks until ownership can be obtained for the current thread.]]
[[Synchronization:] [Prior `unlock()` operations on the same object synchronizes with this operation. ]]
@@ -97,7 +99,12 @@
}
}
-Some of the algorithms on mutexes use this trait via SFINAE. If BOOST_THREAD_NO_AUTO_DETECT_MUTEX_TYPES is defined you will need to specialize this traits for the models of BasicLockable you could build.
+
+Some of the algorithms on mutexes use this trait via SFINAE.
+
+This trait is true_type if the parameter L meets the __Lockable requirements.
+
+[warning If BOOST_THREAD_NO_AUTO_DETECT_MUTEX_TYPES is defined you will need to specialize this traits for the models of BasicLockable you could build.]
[endsect]
[endsect]
@@ -121,6 +128,9 @@
[variablelist
+
+[[Requires:] [The calling thread doesn't owns the mutex if the mutex is not recursive.]]
+
[[Effects:] [Attempt to obtain ownership for the current thread without blocking.]]
[[Synchronization:] [If `try_lock()` returns true, prior `unlock()` operations on the same object synchronize with this operation.]]
@@ -152,7 +162,11 @@
}
}
-Some of the algorithms on mutexes use this trait via SFINAE. If BOOST_THREAD_NO_AUTO_DETECT_MUTEX_TYPES is defined you will need to specialize this traits for the models of Lockable you could build.
+Some of the algorithms on mutexes use this trait via SFINAE.
+
+This trait is true_type if the parameter L meets the __Lockable requirements.
+
+[warning If BOOST_THREAD_NO_AUTO_DETECT_MUTEX_TYPES is defined you will need to specialize this traits for the models of Lockable you could build.]
[endsect]
[endsect]
@@ -185,6 +199,37 @@
[endsect]
+[section:is_recursive_basic_lockable `is_recursive_basic_lockable` trait -- EXTENSION]
+
+ // #include <boost/thread/lockable_traits.hpp>
+ namespace boost
+ {
+ namespace sync
+ {
+ template<typename L>
+ class is_recursive_basic_lockable;// EXTENSION
+ }
+ }
+
+This traits is true_type if is_basic_lockable and is_recursive_mutex_sur_parolle.
+
+[endsect]
+[section:is_recursive_lockable `is_recursive_lockable` trait -- EXTENSION]
+
+ // #include <boost/thread/lockable_traits.hpp>
+ namespace boost
+ {
+ namespace sync
+ {
+ template<typename L>
+ class is_recursive_lockable;// EXTENSION
+ }
+ }
+
+This traits is true_type if is_lockable and is_recursive_mutex_sur_parolle.
+
+[endsect]
+
[endsect]
@@ -220,6 +265,8 @@
[variablelist
+[[Requires:] [The calling thread doesn't owns the mutex if the mutex is not recursive.]]
+
[[Effects:] [Attempt to obtain ownership for the current thread. Blocks until ownership can be obtained, or the specified time is
reached. If the specified time has already passed, behaves as __try_lock_ref__.]]
@@ -239,6 +286,8 @@
[variablelist
+[[Requires:] [The calling thread doesn't owns the mutex if the mutex is not recursive.]]
+
[[Effects:] [As-if `__try_lock_until(chrono::steady_clock::now() + rel_time)`.]]
[[Synchronization:] [If `try_lock_for()` returns true, prior `unlock()` operations on the same object synchronize with this operation.]]
Modified: branches/release/libs/thread/doc/mutexes.qbk
==============================================================================
--- branches/release/libs/thread/doc/mutexes.qbk (original)
+++ branches/release/libs/thread/doc/mutexes.qbk 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -240,409 +240,5 @@
[endsect]
-[section:synchronized_value_ref Synchronized Values]
- namespace boost
- {
-
- template<typename T, typename Lockable = mutex>
- class synchronized_value;
-
- // Specialized swap algorithm
- template <typename T, typename L>
- void swap(synchronized_value<T,L> & lhs, synchronized_value<T,L> & rhs);
- template <typename T, typename L>
- void swap(synchronized_value<T,L> & lhs, T & rhs);
- template <typename T, typename L>
- void swap(T & lhs, synchronized_value<T,L> & rhs);
-
- // Hash support
- template<typename T, typename L>
- struct hash<synchronized_value<T,L> >;
-
- // Comparison
- template <typename T, typename L>
- bool operator==(synchronized_value<T,L> const&lhs, synchronized_value<T,L> const& rhs)
- template <typename T, typename L>
- bool operator!=(synchronized_value<T,L> const&lhs, synchronized_value<T,L> const& rhs)
- template <typename T, typename L>
- bool operator<(synchronized_value<T,L> const&lhs, synchronized_value<T,L> const& rhs)
- template <typename T, typename L>
- bool operator<=(synchronized_value<T,L> const&lhs, synchronized_value<T,L> const& rhs)
- template <typename T, typename L>
- bool operator>(synchronized_value<T,L> const&lhs, synchronized_value<T,L> const& rhs)
- template <typename T, typename L>
- bool operator>=(synchronized_value<T,L> const&lhs, synchronized_value<T,L> const& rhs)
-
- // Comparison with T
- template <typename T, typename L>
- bool operator==(T const& lhs, synchronized_value<T,L> const&rhs);
- template <typename T, typename L>
- bool operator!=(T const& lhs, synchronized_value<T,L> const&rhs);
- template <typename T, typename L>
- bool operator<(T const& lhs, synchronized_value<T,L> const&rhs);
- template <typename T, typename L>
- bool operator<=(T const& lhs, synchronized_value<T,L> const&rhs);
- template <typename T, typename L>
- bool operator>(T const& lhs, synchronized_value<T,L> const&rhs);
- template <typename T, typename L>
- bool operator>=(T const& lhs, synchronized_value<T,L> const&rhs);
-
- template <typename T, typename L>
- bool operator==(synchronized_value<T,L> const& lhs, T const& rhs);
- template <typename T, typename L>
- bool operator!=(synchronized_value<T,L> const& lhs, T const& rhs);
- template <typename T, typename L>
- bool operator<(synchronized_value<T,L> const& lhs, T const& rhs);
- template <typename T, typename L>
- bool operator<=(synchronized_value<T,L> const& lhs, T const& rhs);
- template <typename T, typename L>
- bool operator>(synchronized_value<T,L> const& lhs, T const& rhs);
- template <typename T, typename L>
- bool operator>=(synchronized_value<T,L> const& lhs, T const& rhs);
-
- #if ! defined(BOOST_THREAD_NO_SYNCHRONIZE)
- template <typename ...SV>
- std::tuple<typename synchronized_value_strict_lock_ptr<SV>::type ...> synchronize(SV& ...sv);
- #endif
- }
-
-[section:synchronized_value Class `synchronized_value`]
-
- #include <boost/thread/synchronized_value.hpp>
-
- namespace boost
- {
-
- template<typename T, typename Lockable = mutex>
- class synchronized_value
- {
- public:
- typedef T value_type;
- typedef Lockable mutex_type;
-
- synchronized_value() noexept(is_nothrow_default_constructible<T>::value);
- synchronized_value(T const& other) noexept(is_nothrow_copy_constructible<T>::value);
- synchronized_value(T&& other) noexept(is_nothrow_move_constructible<T>::value);
- synchronized_value(synchronized_value const& rhs);
- synchronized_value(synchronized_value&& other);
-
- // mutation
- synchronized_value& operator=(synchronized_value const& rhs);
- synchronized_value& operator=(value_type const& val);
- void swap(synchronized_value & rhs);
- void swap(value_type & rhs);
-
- //observers
- T get() const;
- #if ! defined(BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS)
- explicit operator T() const;
- #endif
-
- strict_lock_ptr<T,Lockable> operator->();
- const_strict_lock_ptr<T,Lockable> operator->() const;
- strict_lock_ptr<T,Lockable> synchronize();
- const_strict_lock_ptr<T,Lockable> synchronize() const;
-
- deref_value operator*();;
- const_deref_value operator*() const;
-
- private:
- T value_; // for exposition only
- mutable mutex_type mtx_; // for exposition only
- };
- }
-
-[variablelist
-
-[[Requires:] [`Lockable` is `Lockable`.]]
-
-]
-
-
-[section:constructor `synchronized_value()`]
-
- synchronized_value() noexept(is_nothrow_default_constructible<T>::value);
-
-[variablelist
-
-[[Requires:] [`T` is `DefaultConstructible`.]]
-[[Effects:] [Default constructs the cloaked value_type]]
-
-[[Throws:] [Any exception thrown by `value_type()`.]]
-
-]
-
-[endsect]
-
-
-[section:constructor_vt `synchronized_value(T const&)`]
-
- synchronized_value(T const& other) noexept(is_nothrow_copy_constructible<T>::value);
-
-[variablelist
-
-[[Requires:] [`T` is `CopyConstructible`.]]
-[[Effects:] [Copy constructs the cloaked value_type using the parameter `other`]]
-
-[[Throws:] [Any exception thrown by `value_type(other)`.]]
-
-]
-
-[endsect]
-
-[section:copy_cons `synchronized_value(synchronized_value const&)`]
-
- synchronized_value(synchronized_value const& rhs);
-
-[variablelist
-
-[[Requires:] [`T` is `DefaultConstructible` and `Assignable`.]]
-[[Effects:] [Assigns the value on a scope protected by the mutex of the rhs. The mutex is not copied.]]
-
-[[Throws:] [Any exception thrown by `value_type()` or `value_type& operator=(value_type&)` or `mtx_.lock()`.]]
-
-]
-
-[endsect]
-
-[section:move_vt `synchronized_value(T&&)`]
-
- synchronized_value(T&& other) noexept(is_nothrow_move_constructible<T>::value);
-
-[variablelist
-
-[[Requires:] [`T` is `CopyMovable `.]]
-[[Effects:] [Move constructs the cloaked value_type]]
-
-[[Throws:] [Any exception thrown by `value_type(value_type&&)`.]]
-
-]
-
-[endsect]
-
-[section:move `synchronized_value(synchronized_value&&)`]
-
- synchronized_value(synchronized_value&& other);
-
-[variablelist
-
-[[Requires:] [`T` is `CopyMovable `.]]
-[[Effects:] [Move constructs the cloaked value_type]]
-
-[[Throws:] [Any exception thrown by `value_type(value_type&&)` or `mtx_.lock()`.]]
-
-]
-
-[endsect]
-
-[section:assign `operator=(synchronized_value const&)`]
-
- synchronized_value& operator=(synchronized_value const& rhs);
-
-[variablelist
-
-[[Requires:] [`T` is `Assignale`.]]
-[[Effects:] [Copies the underlying value on a scope protected by the two mutexes. The mutex is not copied. The locks are acquired avoiding deadlock. For example, there is no problem if one thread assigns `a = b` and the other assigns `b = a`.]]
-[[Return:] [`*this`]]
-
-[[Throws:] [Any exception thrown by `value_type& operator(value_type const&)` or `mtx_.lock()`.]]
-
-]
-
-[endsect]
-[section:assign_vt `operator=(T const&)`]
-
- synchronized_value& operator=(value_type const& val);
-
-[variablelist
-
-[[Requires:] [`T` is `Assignale`.]]
-[[Effects:] [Copies the value on a scope protected by the mutex.]]
-[[Return:] [`*this`]]
-
-[[Throws:] [Any exception thrown by `value_type& operator(value_type const&)` or `mtx_.lock()`.]]
-
-]
-
-[endsect]
-
-[section:get `get() const`]
-
- T get() const;
-
-[variablelist
-
-[[Requires:] [`T` is `CopyConstructible`.]]
-[[Return:] [`A copy of the protected value obtained on a scope protected by the mutex.`]]
-
-[[Throws:] [Any exception thrown by `value_type(value_type const&)` or `mtx_.lock()`.]]
-
-]
-
-[endsect]
-
-
-[section:T `operator T() const`]
-
- #if ! defined(BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS)
- explicit operator T() const;
- #endif
-
-[variablelist
-
-[[Requires:] [`T` is `CopyConstructible`.]]
-[[Return:] [`A copy of the protected value obtained on a scope protected by the mutex.`]]
-
-[[Throws:] [Any exception thrown by `value_type(value_type const&)` or `mtx_.lock()`.]]
-
-]
-
-[endsect]
-
-[section:swap `swap(synchronized_value&)`]
-
- void swap(synchronized_value & rhs);
-
-[variablelist
-
-[[Requires:] [`T` is `Assignale`.]]
-[[Effects:] [Swaps the data on a scope protected by both mutex. Both mutex are acquired to avoid dead-lock. The mutexes are not swapped.]]
-
-[[Throws:] [Any exception thrown by `swap(value_, rhs.value)` or `mtx_.lock()` or `rhs_.mtx_.lock()`.]]
-
-]
-
-[endsect]
-
-[section:swap_vt `swap(synchronized_value&)`]
-
- void swap(value_type & rhs);
-
-[variablelist
-
-[[Requires:] [`T` is `Swapable`.]]
-[[Effects:] [Swaps the data on a scope protected by both mutex. Both mutex are acquired to avoid dead-lock. The mutexes are not swapped.]]
-
-[[Throws:] [Any exception thrown by `swap(value_, rhs)` or `mtx_.lock()`.]]
-
-]
-
-[endsect]
-[section:indir `operator->()`]
-
- strict_lock_ptr<T,Lockable> operator->();
-
-
-Essentially calling a method `obj->foo(x, y, z)` calls the method `foo(x, y, z)` inside a critical section as long-lived as the call itself.
-
-[variablelist
-
-[[Return:] [`A strict_lock_ptr<>.`]]
-
-[[Throws:] [Nothing.]]
-
-]
-
-[endsect]
-[section:indir_const `operator->() const`]
-
- const_strict_lock_ptr<T,Lockable> operator->() const;
-
-
-If the `synchronized_value` object involved is const-qualified, then you'll only be able to call const methods
-through `operator->`. So, for example, `vec->push_back("xyz")` won't work if `vec` were const-qualified.
-The locking mechanism capitalizes on the assumption that const methods don't modify their underlying data.
-
-[variablelist
-
-[[Return:] [`A const_strict_lock_ptr <>.`]]
-
-[[Throws:] [Nothing.]]
-
-]
-
-[endsect]
-[section:synchronize `synchronize()`]
-
- strict_lock_ptr<T,Lockable> synchronize();
-
-The synchronize() factory make easier to lock on a scope. As discussed, `operator->` can only lock over the duration of a call, so it is insufficient for complex operations. With `synchronize()` you get to lock the object in a scoped and to directly access the object inside that scope.
-
-[*Example:]
-
- void fun(synchronized_value<vector<int>> & vec) {
- auto vec2=vec.synchronize();
- vec2.push_back(42);
- assert(vec2.back() == 42);
- }
-
-[variablelist
-
-[[Return:] [`A strict_lock_ptr <>.`]]
-
-[[Throws:] [Nothing.]]
-
-]
-
-[endsect]
-[section:synchronize_const `synchronize() const`]
-
- const_strict_lock_ptr<T,Lockable> synchronize() const;
-
-[variablelist
-
-[[Return:] [`A const_strict_lock_ptr <>.`]]
-
-[[Throws:] [Nothing.]]
-
-]
-
-[endsect]
-
-[section:deref `operator*()`]
-
- deref_value operator*();;
-
-[variablelist
-
-[[Return:] [`A an instance of a class that locks the mutex on construction and unlocks it on destruction and provides implicit conversion to a reference to the protected value.`]]
-
-[[Throws:] [Nothing.]]
-
-]
-
-[endsect]
-[section:deref_const `operator*() const`]
-
- const_deref_value operator*() const;
-
-
-[variablelist
-
-[[Return:] [`A an instance of a class that locks the mutex on construction and unlocks it on destruction and provides implicit conversion to a constant reference to the protected value.`]]
-
-[[Throws:] [Nothing.]]
-
-]
-
-[endsect]
-
-
-
-
-[endsect]
-[section:synchronize Non-Member Function `synchronize`]
-
- #include <boost/thread/synchronized_value.hpp>
- namespace boost
- {
- #if ! defined(BOOST_THREAD_NO_SYNCHRONIZE)
- template <typename ...SV>
- std::tuple<typename synchronized_value_strict_lock_ptr<SV>::type ...> synchronize(SV& ...sv);
- #endif
- }
-
-[endsect]
-[endsect]
Modified: branches/release/libs/thread/doc/once.qbk
==============================================================================
--- branches/release/libs/thread/doc/once.qbk (original)
+++ branches/release/libs/thread/doc/once.qbk 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -21,6 +21,11 @@
}
+[warning the variadic prototype is provided only on C++11 compilers supporting variadic templates, otherwise the interface is limited up to 3 parameters.]
+
+[warning the move semantics is ensured only on C++11 compilers supporting SFINAE expression, decltype N3276 and auto. Waiting for a boost::bind that is move aware.]
+
+
`boost::call_once` provides a mechanism for ensuring that an initialization routine is run exactly once without data races or deadlocks.
[section:once_flag Typedef `once_flag`]
@@ -71,6 +76,9 @@
function, in which case it could also avoid calling `call_once`
recursively.]]
+
+[[Note:] [On some compilers this function has some restrictions, e.g. if variadic templates are not supported the number of arguments is limited to 3; .]]
+
]
void call_once(void (*func)(),once_flag& flag);
Modified: branches/release/libs/thread/doc/sync_tutorial.qbk
==============================================================================
--- branches/release/libs/thread/doc/sync_tutorial.qbk (original)
+++ branches/release/libs/thread/doc/sync_tutorial.qbk 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -18,8 +18,6 @@
[include external_locking.qbk]
-[include synchronized_value.qbk]
-
[section:with Executing Around a Function]
In particular, the library provides some lock factories.
Modified: branches/release/libs/thread/doc/synchronized_value.qbk
==============================================================================
--- branches/release/libs/thread/doc/synchronized_value.qbk (original)
+++ branches/release/libs/thread/doc/synchronized_value.qbk 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -6,7 +6,13 @@
/]
-[section Synchronized values]
+[section:synchronized_valuesxxx Synchronized values - EXPERIMENTAL]
+
+[warning These features are experimental and subject to change in future versions. There are not too much tests yet, so it is possible that you can find out some trivial bugs :(]
+
+[section:tutorial Tutorial]
+
+
[note This tutorial is an adaptation of the paper of Anthony Williams "Enforcing Correct Mutex Usage with Synchronized Values" to the Boost library.]
[section The Problem with Mutexes]
@@ -133,8 +139,9 @@
[endsect] [/Value semantics]
-[endsect] [/Synchronized variables]
-
+[endsect] [/tutorial]
+[include synchronized_value_ref.qbk]
+[endsect] [/Synchronized values]
Modified: branches/release/libs/thread/doc/thread.qbk
==============================================================================
--- branches/release/libs/thread/doc/thread.qbk (original)
+++ branches/release/libs/thread/doc/thread.qbk 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -8,10 +8,10 @@
[library Thread
[quickbook 1.5]
- [version 4.0.0]
+ [version 4.1.0]
[authors [Williams, Anthony] [Botet Escriba, Vicente J.]]
[copyright 2007-11 Anthony Williams]
- [copyright 2011-12 Vicente J. Botet Escriba]
+ [copyright 2011-13 Vicente J. Botet Escriba]
[purpose C++ Library for launching threads and synchronizing data between them]
[category text]
[license
@@ -235,15 +235,21 @@
[include sync_tutorial.qbk]
[include mutex_concepts.qbk]
[include mutexes.qbk]
-[/include synchronized_value_ref.qbk]
[include condition_variables.qbk]
[include once.qbk]
[include barrier.qbk]
[include futures.qbk]
[endsect]
+
[include tss.qbk]
+[section:sds Synchronized Data Structures]
+[include synchronized_value.qbk]
+[/include sync_queues_ref.qbk]
+[/include sync_streams.qbk]
+[endsect]
+
[include time.qbk]
[include emulations.qbk]
Modified: branches/release/libs/thread/example/condition.cpp
==============================================================================
--- branches/release/libs/thread/example/condition.cpp (original)
+++ branches/release/libs/thread/example/condition.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -8,7 +8,7 @@
#include <vector>
#include <boost/utility.hpp>
#include <boost/thread/condition_variable.hpp>
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include "../test/remove_error_code_unused_warning.hpp"
class bounded_buffer : private boost::noncopyable
Modified: branches/release/libs/thread/example/future_then.cpp
==============================================================================
--- branches/release/libs/thread/example/future_then.cpp (original)
+++ branches/release/libs/thread/example/future_then.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -4,9 +4,9 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//#define BOOST_THREAD_VERSION 4
-//#define BOOST_THREAD_USES_LOG
+#define BOOST_THREAD_USES_LOG
#define BOOST_THREAD_USES_LOG_THREAD_ID
-//#define BOOST_THREAD_DONT_PROVIDE_FUTURE_INVALID_AFTER_GET
+#define BOOST_THREAD_DONT_PROVIDE_FUTURE_INVALID_AFTER_GET
#include <boost/thread/detail/log.hpp>
#include <boost/thread/future.hpp>
Modified: branches/release/libs/thread/example/monitor.cpp
==============================================================================
--- branches/release/libs/thread/example/monitor.cpp (original)
+++ branches/release/libs/thread/example/monitor.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -9,7 +9,7 @@
#include <boost/thread/condition_variable.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/thread/recursive_mutex.hpp>
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
namespace {
const int ITERS = 100;
Modified: branches/release/libs/thread/example/not_interleaved.cpp
==============================================================================
--- branches/release/libs/thread/example/not_interleaved.cpp (original)
+++ branches/release/libs/thread/example/not_interleaved.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -15,7 +15,7 @@
void use_cerr(boost::externally_locked_stream<std::ostream> &mcerr)
{
using namespace boost;
- auto tf = chrono::steady_clock::now() + chrono::seconds(10);
+ chrono::steady_clock::time_point tf = chrono::steady_clock::now() + chrono::seconds(10);
while (chrono::steady_clock::now() < tf)
{
mcerr << "logging data to cerr\n";
@@ -26,7 +26,7 @@
void use_cout(boost::externally_locked_stream<std::ostream> &mcout)
{
using namespace boost;
- auto tf = chrono::steady_clock::now() + chrono::seconds(5);
+ chrono::steady_clock::time_point tf = chrono::steady_clock::now() + chrono::seconds(5);
while (chrono::steady_clock::now() < tf)
{
mcout << "logging data to cout\n";
@@ -50,14 +50,14 @@
std::string nm;
{
strict_lock<recursive_mutex> lk(terminal_mutex);
- auto& gcout = mcout.hold(lk);
- auto& gcin = mcin.hold(lk);
+ std::ostream & gcout = mcout.hold(lk);
+ //std::istream & gcin = mcin.hold(lk);
gcout << "Enter name: ";
//gcin >> nm;
}
t1.join();
t2.join();
mcout << nm << '\n';
- return 1;
+ return 0;
}
Modified: branches/release/libs/thread/example/perf_shared_mutex.cpp
==============================================================================
--- branches/release/libs/thread/example/perf_shared_mutex.cpp (original)
+++ branches/release/libs/thread/example/perf_shared_mutex.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -12,7 +12,7 @@
#include <iostream>
#include <boost/thread/lock_types.hpp>
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <boost/chrono/chrono_io.hpp>
#include <boost/thread/shared_mutex.hpp>
Copied: branches/release/libs/thread/example/producer_consumer.cpp (from r83647, /trunk/libs/thread/example/producer_consumer.cpp)
==============================================================================
--- /trunk/libs/thread/example/producer_consumer.cpp (original)
+++ branches/release/libs/thread/example/producer_consumer.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -19,9 +19,9 @@
try {
for(int i=0; ;++i)
{
- //sbq.wait_and_push(i);
+ //sbq.push(i);
sbq << i;
- mos << "wait_and_push(" << i << ") "<< sbq.size()<<"\n";
+ mos << "push(" << i << ") "<< sbq.size()<<"\n";
this_thread::sleep_for(chrono::milliseconds(200));
}
}
@@ -42,9 +42,9 @@
for(int i=0; ;++i)
{
int r;
- //sbq.wait_and_pop(r);
+ //sbq.pull(r);
sbq >> r;
- mos << i << " wait_and_pop(" << r << ") "<< sbq.size()<<"\n";
+ mos << i << " pull(" << r << ") "<< sbq.size()<<"\n";
this_thread::sleep_for(chrono::milliseconds(250));
}
}
@@ -65,9 +65,9 @@
for(int i=0; ;++i)
{
int r;
- sbq.wait_and_pop(r, closed);
+ sbq.pull(r, closed);
if (closed) break;
- mos << i << " wait_and_pop(" << r << ")\n";
+ mos << i << " pull(" << r << ")\n";
this_thread::sleep_for(chrono::milliseconds(250));
}
}
@@ -84,9 +84,9 @@
// for(int i=0; ;++i)
// {
// int r;
-// queue_op_status res = sbq.wait_and_pop(r);
+// queue_op_status res = sbq.wait_and_pull(r);
// if (res==queue_op_status::closed) break;
-// mos << i << " wait_and_pop(" << r << ")\n";
+// mos << i << " wait_and_pull(" << r << ")\n";
// this_thread::sleep_for(chrono::milliseconds(250));
// }
// }
Copied: branches/release/libs/thread/example/producer_consumer_bounded.cpp (from r83647, /trunk/libs/thread/example/producer_consumer_bounded.cpp)
==============================================================================
--- /trunk/libs/thread/example/producer_consumer_bounded.cpp (original)
+++ branches/release/libs/thread/example/producer_consumer_bounded.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -19,9 +19,9 @@
try {
for(int i=0; ;++i)
{
- //sbq.wait_and_push(i);
+ //sbq.push(i);
sbq << i;
- mos << "wait_and_push(" << i << ") "<< sbq.size()<<"\n";
+ mos << "push(" << i << ") "<< sbq.size()<<"\n";
this_thread::sleep_for(chrono::milliseconds(200));
}
}
@@ -42,9 +42,9 @@
for(int i=0; ;++i)
{
int r;
- //sbq.wait_and_pop(r);
+ //sbq.pull(r);
sbq >> r;
- mos << i << " wait_and_pop(" << r << ") "<< sbq.size()<<"\n";
+ mos << i << " pull(" << r << ") "<< sbq.size()<<"\n";
this_thread::sleep_for(chrono::milliseconds(250));
}
}
@@ -65,9 +65,9 @@
for(int i=0; ;++i)
{
int r;
- sbq.wait_and_pop(r, closed);
+ sbq.pull(r, closed);
if (closed) break;
- mos << i << " wait_and_pop(" << r << ")\n";
+ mos << i << " pull(" << r << ")\n";
this_thread::sleep_for(chrono::milliseconds(250));
}
}
@@ -84,9 +84,9 @@
// for(int i=0; ;++i)
// {
// int r;
-// queue_op_status res = sbq.wait_and_pop(r);
+// queue_op_status res = sbq.wait_and_pull(r);
// if (res==queue_op_status::closed) break;
-// mos << i << " wait_and_pop(" << r << ")\n";
+// mos << i << " wait_and_pull(" << r << ")\n";
// this_thread::sleep_for(chrono::milliseconds(250));
// }
// }
Modified: branches/release/libs/thread/example/shared_monitor.cpp
==============================================================================
--- branches/release/libs/thread/example/shared_monitor.cpp (original)
+++ branches/release/libs/thread/example/shared_monitor.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -7,7 +7,7 @@
#include <boost/thread/mutex.hpp>
#include <boost/thread/shared_mutex.hpp>
#include <boost/thread/lock_algorithms.hpp>
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#if defined BOOST_THREAD_DONT_USE_CHRONO
#include <boost/chrono/chrono_io.hpp>
#endif
Modified: branches/release/libs/thread/example/shared_mutex.cpp
==============================================================================
--- branches/release/libs/thread/example/shared_mutex.cpp (original)
+++ branches/release/libs/thread/example/shared_mutex.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -11,7 +11,7 @@
#include <boost/thread/mutex.hpp>
#include <boost/thread/shared_mutex.hpp>
#include <boost/thread/lock_algorithms.hpp>
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <vector>
#if defined BOOST_THREAD_USES_CHRONO
Modified: branches/release/libs/thread/example/starvephil.cpp
==============================================================================
--- branches/release/libs/thread/example/starvephil.cpp (original)
+++ branches/release/libs/thread/example/starvephil.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -8,7 +8,7 @@
#include <boost/thread/mutex.hpp>
#include <boost/thread/condition.hpp>
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <boost/thread/xtime.hpp>
#include <iostream>
#include <time.h>
Modified: branches/release/libs/thread/example/tennis.cpp
==============================================================================
--- branches/release/libs/thread/example/tennis.cpp (original)
+++ branches/release/libs/thread/example/tennis.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -6,7 +6,7 @@
#include <boost/thread/mutex.hpp>
#include <boost/thread/condition.hpp>
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <boost/thread/xtime.hpp>
#include <iostream>
Modified: branches/release/libs/thread/example/thread.cpp
==============================================================================
--- branches/release/libs/thread/example/thread.cpp (original)
+++ branches/release/libs/thread/example/thread.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -6,7 +6,7 @@
#define BOOST_THREAD_VERSION 2
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <boost/thread/xtime.hpp>
#include <iostream>
Modified: branches/release/libs/thread/example/thread_guard.cpp
==============================================================================
--- branches/release/libs/thread/example/thread_guard.cpp (original)
+++ branches/release/libs/thread/example/thread_guard.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -7,7 +7,7 @@
#include <iostream>
#include <string>
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <boost/thread/thread_guard.hpp>
void do_something(int& i)
Modified: branches/release/libs/thread/example/xtime.cpp
==============================================================================
--- branches/release/libs/thread/example/xtime.cpp (original)
+++ branches/release/libs/thread/example/xtime.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -6,7 +6,7 @@
#define BOOST_THREAD_VERSION 2
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <boost/thread/xtime.hpp>
int main()
Modified: branches/release/libs/thread/test/Jamfile.v2
==============================================================================
--- branches/release/libs/thread/test/Jamfile.v2 (original)
+++ branches/release/libs/thread/test/Jamfile.v2 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -667,6 +667,9 @@
[ thread-run2-noit ../example/scoped_thread.cpp : ex_scoped_thread ]
[ thread-run2-noit ../example/strict_lock.cpp : ex_strict_lock ]
[ thread-run2-noit ../example/ba_externallly_locked.cpp : ex_ba_externallly_locked ]
+ [ thread-run ../example/producer_consumer_bounded.cpp ]
+ [ thread-run ../example/producer_consumer.cpp ]
+ [ thread-run ../example/not_interleaved.cpp ]
;
@@ -736,8 +739,6 @@
#[ thread-run ../example/unwrap.cpp ]
#[ thread-run ../example/perf_condition_variable.cpp ]
#[ thread-run ../example/perf_shared_mutex.cpp ]
- #[ thread-run ../example/not_interleaved.cpp ]
-
;
}
Modified: branches/release/libs/thread/test/sync/futures/future/then_pass.cpp
==============================================================================
--- branches/release/libs/thread/test/sync/futures/future/then_pass.cpp (original)
+++ branches/release/libs/thread/test/sync/futures/future/then_pass.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -12,7 +12,7 @@
#define BOOST_THREAD_VERSION 4
#define BOOST_THREAD_DONT_PROVIDE_FUTURE_INVALID_AFTER_GET
-//#define BOOST_THREAD_USES_LOG
+#define BOOST_THREAD_USES_LOG
#define BOOST_THREAD_USES_LOG_THREAD_ID
#include <boost/thread/detail/log.hpp>
Modified: branches/release/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/cons/adopt_lock_pass.cpp
==============================================================================
--- branches/release/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/cons/adopt_lock_pass.cpp (original)
+++ branches/release/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/cons/adopt_lock_pass.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -27,7 +27,7 @@
int main()
{
boost::shared_mutex m;
- m.lock();
+ m.lock_shared();
boost::shared_lock<boost::shared_mutex> lk(m, boost::adopt_lock);
BOOST_TEST(lk.mutex() == &m);
BOOST_TEST(lk.owns_lock() == true);
Modified: branches/release/libs/thread/test/sync/mutual_exclusion/locks/shared_lock_guard/adopt_lock_pass.cpp
==============================================================================
--- branches/release/libs/thread/test/sync/mutual_exclusion/locks/shared_lock_guard/adopt_lock_pass.cpp (original)
+++ branches/release/libs/thread/test/sync/mutual_exclusion/locks/shared_lock_guard/adopt_lock_pass.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -40,7 +40,7 @@
time_point t0 = Clock::now();
time_point t1;
{
- m.lock();
+ m.lock_shared();
boost::shared_lock_guard<boost::shared_mutex> lg(m, boost::adopt_lock);
t1 = Clock::now();
}
@@ -50,7 +50,7 @@
//time_point t0 = Clock::now();
//time_point t1;
{
- m.lock();
+ m.lock_shared();
boost::shared_lock_guard<boost::shared_mutex> lg(m, boost::adopt_lock);
//t1 = Clock::now();
}
Modified: branches/release/libs/thread/test/test_2741.cpp
==============================================================================
--- branches/release/libs/thread/test/test_2741.cpp (original)
+++ branches/release/libs/thread/test/test_2741.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -7,7 +7,7 @@
#include <boost/thread/detail/config.hpp>
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <boost/thread/xtime.hpp>
#include <boost/bind.hpp>
#include <boost/ref.hpp>
Modified: branches/release/libs/thread/test/test_3837.cpp
==============================================================================
--- branches/release/libs/thread/test/test_3837.cpp (original)
+++ branches/release/libs/thread/test/test_3837.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -5,6 +5,7 @@
#include <iostream>
#include <boost/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <boost/optional.hpp>
#include <boost/detail/lightweight_test.hpp>
Modified: branches/release/libs/thread/test/test_4521.cpp
==============================================================================
--- branches/release/libs/thread/test/test_4521.cpp (original)
+++ branches/release/libs/thread/test/test_4521.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -5,7 +5,8 @@
#define BOOST_THREAD_VERSION 2
-#include <boost/thread.hpp>
+#include <boost/thread/thread_only.hpp>
+#include <boost/thread/future.hpp>
int calculate_the_answer_to_life_the_universe_and_everything()
{
Modified: branches/release/libs/thread/test/test_4882.cpp
==============================================================================
--- branches/release/libs/thread/test/test_4882.cpp (original)
+++ branches/release/libs/thread/test/test_4882.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -7,7 +7,7 @@
//#define BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN
//#define BOOST_THREAD_USES_LOG
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <boost/thread/shared_mutex.hpp>
#include <boost/detail/no_exceptions_support.hpp>
//#include <boost/thread/detail/log.hpp>
Modified: branches/release/libs/thread/test/test_5351.cpp
==============================================================================
--- branches/release/libs/thread/test/test_5351.cpp (original)
+++ branches/release/libs/thread/test/test_5351.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -6,7 +6,7 @@
#define BOOST_THREAD_PROVIDES_INTERRUPTIONS
#include <iostream>
-#include <boost/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <boost/date_time/posix_time/posix_time_types.hpp>
#include <boost/thread/future.hpp>
Modified: branches/release/libs/thread/test/test_5502.cpp
==============================================================================
--- branches/release/libs/thread/test/test_5502.cpp (original)
+++ branches/release/libs/thread/test/test_5502.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -12,7 +12,7 @@
int XXX = 20;
int YYY = 10;
-#include <boost/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <boost/thread/shared_mutex.hpp>
//#include <unistd.h>
Modified: branches/release/libs/thread/test/test_5542_1.cpp
==============================================================================
--- branches/release/libs/thread/test/test_5542_1.cpp (original)
+++ branches/release/libs/thread/test/test_5542_1.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -6,7 +6,7 @@
#define BOOST_THREAD_VERSION 2
#include <iostream>
-#include <boost/thread.hpp>
+#include <boost/thread/thread_only.hpp>
class Worker
{
Modified: branches/release/libs/thread/test/test_5542_2.cpp
==============================================================================
--- branches/release/libs/thread/test/test_5542_2.cpp (original)
+++ branches/release/libs/thread/test/test_5542_2.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -5,7 +5,7 @@
#define BOOST_THREAD_VERSION 2
-#include <boost/thread.hpp>
+#include <boost/thread/thread_only.hpp>
void run_thread() {
return;
Modified: branches/release/libs/thread/test/test_5542_3.cpp
==============================================================================
--- branches/release/libs/thread/test/test_5542_3.cpp (original)
+++ branches/release/libs/thread/test/test_5542_3.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -6,7 +6,7 @@
#define BOOST_THREAD_VERSION 2
#include <iostream>
-#include <boost/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <boost/date_time.hpp>
void workerFunc()
Modified: branches/release/libs/thread/test/test_5891.cpp
==============================================================================
--- branches/release/libs/thread/test/test_5891.cpp (original)
+++ branches/release/libs/thread/test/test_5891.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -6,7 +6,7 @@
#define BOOST_THREAD_VERSION 2
#include <iostream>
-#include <boost/thread.hpp>
+#include <boost/thread/thread_only.hpp>
using namespace std;
using namespace boost;
Modified: branches/release/libs/thread/test/test_6130.cpp
==============================================================================
--- branches/release/libs/thread/test/test_6130.cpp (original)
+++ branches/release/libs/thread/test/test_6130.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -5,7 +5,7 @@
#define BOOST_THREAD_VERSION 2
-#include <boost/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <boost/date_time/posix_time/posix_time_io.hpp>
#include <assert.h>
#include <iostream>
Modified: branches/release/libs/thread/test/test_6174.cpp
==============================================================================
--- branches/release/libs/thread/test/test_6174.cpp (original)
+++ branches/release/libs/thread/test/test_6174.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -6,7 +6,8 @@
#define BOOST_THREAD_VERSION 3
-#include <boost/thread.hpp>
+#include <boost/thread/thread_only.hpp>
+#include <boost/thread/future.hpp>
#include <boost/config.hpp>
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
Modified: branches/release/libs/thread/test/test_7160.cpp
==============================================================================
--- branches/release/libs/thread/test/test_7160.cpp (original)
+++ branches/release/libs/thread/test/test_7160.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -6,7 +6,7 @@
#define BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG
#include <iostream>
-#include <boost/thread.hpp>
+#include <boost/thread/thread_only.hpp>
class ThreadClass
{
Modified: branches/release/libs/thread/test/test_7328.cpp
==============================================================================
--- branches/release/libs/thread/test/test_7328.cpp (original)
+++ branches/release/libs/thread/test/test_7328.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -6,7 +6,7 @@
#define BOOST_THREAD_PROVIDES_INTERRUPTIONS
#include <iostream>
-#include <boost/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <boost/detail/lightweight_test.hpp>
#if defined BOOST_THREAD_USES_CHRONO
Modified: branches/release/libs/thread/test/test_7571.cpp
==============================================================================
--- branches/release/libs/thread/test/test_7571.cpp (original)
+++ branches/release/libs/thread/test/test_7571.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -7,7 +7,7 @@
#include <boost/date_time.hpp>
#include <boost/thread/mutex.hpp>
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <iostream>
// Number should be big enough to allow context switch between threads, otherwise the bug doesn't show.
Modified: branches/release/libs/thread/test/test_7665.cpp
==============================================================================
--- branches/release/libs/thread/test/test_7665.cpp (original)
+++ branches/release/libs/thread/test/test_7665.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -7,7 +7,7 @@
#define BOOST_THREAD_USES_LOG
#include <iostream>
-#include <boost/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <boost/thread/detail/log.hpp>
void thread()
Modified: branches/release/libs/thread/test/test_7666.cpp
==============================================================================
--- branches/release/libs/thread/test/test_7666.cpp (original)
+++ branches/release/libs/thread/test/test_7666.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -6,7 +6,7 @@
#define BOOST_CHRONO_VERSION 2
#define BOOST_THREAD_VERSION 2
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
void myFunc()
{
Modified: branches/release/libs/thread/test/test_7720.cpp
==============================================================================
--- branches/release/libs/thread/test/test_7720.cpp (original)
+++ branches/release/libs/thread/test/test_7720.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -6,7 +6,7 @@
////////////////////////////////////////////
//#define BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <boost/thread/shared_mutex.hpp>
using namespace boost;
Modified: branches/release/libs/thread/test/test_7755.cpp
==============================================================================
--- branches/release/libs/thread/test/test_7755.cpp (original)
+++ branches/release/libs/thread/test/test_7755.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -7,7 +7,7 @@
//#define BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN
#include <iostream>
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <boost/thread/shared_mutex.hpp>
// shared_mutex_deadlock.cpp : Defines the entry point for the console application.
//
Modified: branches/release/libs/thread/test/test_condition.cpp
==============================================================================
--- branches/release/libs/thread/test/test_condition.cpp (original)
+++ branches/release/libs/thread/test/test_condition.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -11,7 +11,7 @@
#include <boost/thread/detail/config.hpp>
#include <boost/thread/condition.hpp>
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <boost/thread/xtime.hpp>
#include <boost/test/unit_test.hpp>
Modified: branches/release/libs/thread/test/test_condition_notify_all.cpp
==============================================================================
--- branches/release/libs/thread/test/test_condition_notify_all.cpp (original)
+++ branches/release/libs/thread/test/test_condition_notify_all.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -7,7 +7,7 @@
#include <boost/thread/detail/config.hpp>
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <boost/test/unit_test.hpp>
Modified: branches/release/libs/thread/test/test_condition_notify_one.cpp
==============================================================================
--- branches/release/libs/thread/test/test_condition_notify_one.cpp (original)
+++ branches/release/libs/thread/test/test_condition_notify_one.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -7,7 +7,7 @@
#include <boost/thread/detail/config.hpp>
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <boost/test/unit_test.hpp>
Modified: branches/release/libs/thread/test/test_condition_timed_wait_times_out.cpp
==============================================================================
--- branches/release/libs/thread/test/test_condition_timed_wait_times_out.cpp (original)
+++ branches/release/libs/thread/test/test_condition_timed_wait_times_out.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -8,7 +8,7 @@
#include <boost/thread/detail/config.hpp>
#include <boost/thread/condition.hpp>
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <boost/test/unit_test.hpp>
#include "./util.inl"
Modified: branches/release/libs/thread/test/test_futures.cpp
==============================================================================
--- branches/release/libs/thread/test/test_futures.cpp (original)
+++ branches/release/libs/thread/test/test_futures.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -6,7 +6,7 @@
#define BOOST_THREAD_VERSION 2
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/thread/condition.hpp>
#include <boost/thread/future.hpp>
Modified: branches/release/libs/thread/test/test_generic_locks.cpp
==============================================================================
--- branches/release/libs/thread/test/test_generic_locks.cpp (original)
+++ branches/release/libs/thread/test/test_generic_locks.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -7,7 +7,7 @@
#include <boost/test/unit_test.hpp>
#include <boost/thread/mutex.hpp>
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <boost/thread/locks.hpp>
#include <boost/thread/condition_variable.hpp>
Modified: branches/release/libs/thread/test/test_hardware_concurrency.cpp
==============================================================================
--- branches/release/libs/thread/test/test_hardware_concurrency.cpp (original)
+++ branches/release/libs/thread/test/test_hardware_concurrency.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -2,7 +2,7 @@
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <boost/test/unit_test.hpp>
#include <boost/thread/mutex.hpp>
Modified: branches/release/libs/thread/test/test_lock_concept.cpp
==============================================================================
--- branches/release/libs/thread/test/test_lock_concept.cpp (original)
+++ branches/release/libs/thread/test/test_lock_concept.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -10,7 +10,7 @@
#include <boost/thread/mutex.hpp>
#include <boost/thread/lock_types.hpp>
#include <boost/thread/shared_mutex.hpp>
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <boost/thread/recursive_mutex.hpp>
#include <boost/thread/condition_variable.hpp>
@@ -227,6 +227,19 @@
BOOST_CHECK(lock.owns_lock());
}
};
+template<typename Mutex,typename Lock>
+struct test_initially_lock_shared_with_adopt_lock_parameter
+{
+ void operator()() const
+ {
+ Mutex m;
+ m.lock_shared();
+ Lock lock(m,boost::adopt_lock);
+
+ BOOST_CHECK(lock);
+ BOOST_CHECK(lock.owns_lock());
+ }
+};
template<typename Mutex,typename Lock>
@@ -531,7 +544,7 @@
test_initially_unlocked_with_try_lock_if_other_thread_has_unique_lock<Mutex,Lock>()();
test_initially_locked_if_other_thread_has_shared_lock<Mutex,Lock>()();
test_initially_unlocked_with_defer_lock_parameter<Mutex,Lock>()();
- test_initially_locked_with_adopt_lock_parameter<Mutex,Lock>()();
+ test_initially_lock_shared_with_adopt_lock_parameter<Mutex,Lock>()();
test_unlocked_after_unlock_called<Mutex,Lock>()();
test_locked_after_lock_called<Mutex,Lock>()();
test_locked_after_try_lock_called<Mutex,Lock>()();
Modified: branches/release/libs/thread/test/test_move_function.cpp
==============================================================================
--- branches/release/libs/thread/test/test_move_function.cpp (original)
+++ branches/release/libs/thread/test/test_move_function.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -5,7 +5,7 @@
#define BOOST_THREAD_VERSION 2
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <boost/test/unit_test.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/shared_ptr.hpp>
Modified: branches/release/libs/thread/test/test_mutex.cpp
==============================================================================
--- branches/release/libs/thread/test/test_mutex.cpp (original)
+++ branches/release/libs/thread/test/test_mutex.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -10,7 +10,7 @@
#include <boost/thread/mutex.hpp>
#include <boost/thread/lock_types.hpp>
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <boost/thread/recursive_mutex.hpp>
#include <boost/thread/thread_time.hpp>
#include <boost/thread/condition.hpp>
Modified: branches/release/libs/thread/test/test_shared_mutex.cpp
==============================================================================
--- branches/release/libs/thread/test/test_shared_mutex.cpp (original)
+++ branches/release/libs/thread/test/test_shared_mutex.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -20,6 +20,7 @@
void test_multiple_readers()
{
+ std::cout << __LINE__ << std::endl;
unsigned const number_of_threads=10;
boost::thread_group pool;
@@ -67,6 +68,7 @@
void test_only_one_writer_permitted()
{
+ std::cout << __LINE__ << std::endl;
unsigned const number_of_threads=10;
boost::thread_group pool;
@@ -109,6 +111,7 @@
void test_reader_blocks_writer()
{
+ std::cout << __LINE__ << std::endl;
boost::thread_group pool;
boost::shared_mutex rw_mutex;
@@ -155,6 +158,7 @@
void test_unlocking_writer_unblocks_all_readers()
{
+ std::cout << __LINE__ << std::endl;
boost::thread_group pool;
boost::shared_mutex rw_mutex;
@@ -206,6 +210,7 @@
void test_unlocking_last_reader_only_unblocks_one_writer()
{
+ std::cout << __LINE__ << std::endl;
boost::thread_group pool;
boost::shared_mutex rw_mutex;
Modified: branches/release/libs/thread/test/test_shared_mutex_part_2.cpp
==============================================================================
--- branches/release/libs/thread/test/test_shared_mutex_part_2.cpp (original)
+++ branches/release/libs/thread/test/test_shared_mutex_part_2.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -51,7 +51,7 @@
void test_only_one_upgrade_lock_permitted()
{
- unsigned const number_of_threads=10;
+ unsigned const number_of_threads=2;
boost::thread_group pool;
Modified: branches/release/libs/thread/test/test_shared_mutex_timed_locks.cpp
==============================================================================
--- branches/release/libs/thread/test/test_shared_mutex_timed_locks.cpp (original)
+++ branches/release/libs/thread/test/test_shared_mutex_timed_locks.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -6,7 +6,7 @@
#define BOOST_THREAD_VERSION 2
#include <boost/test/unit_test.hpp>
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <boost/thread/xtime.hpp>
#include "./util.inl"
#include "./shared_mutex_locking_thread.hpp"
Modified: branches/release/libs/thread/test/test_thread.cpp
==============================================================================
--- branches/release/libs/thread/test/test_thread.cpp (original)
+++ branches/release/libs/thread/test/test_thread.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -10,7 +10,7 @@
#include <boost/thread/detail/config.hpp>
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <boost/thread/xtime.hpp>
#include <boost/bind.hpp>
#include <boost/ref.hpp>
Modified: branches/release/libs/thread/test/test_thread_exit.cpp
==============================================================================
--- branches/release/libs/thread/test/test_thread_exit.cpp (original)
+++ branches/release/libs/thread/test/test_thread_exit.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -4,7 +4,7 @@
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/thread/condition.hpp>
#include <boost/thread/future.hpp>
Modified: branches/release/libs/thread/test/test_thread_id.cpp
==============================================================================
--- branches/release/libs/thread/test/test_thread_id.cpp (original)
+++ branches/release/libs/thread/test/test_thread_id.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -2,7 +2,7 @@
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <boost/test/unit_test.hpp>
#include <boost/bind.hpp>
Modified: branches/release/libs/thread/test/test_thread_launching.cpp
==============================================================================
--- branches/release/libs/thread/test/test_thread_launching.cpp (original)
+++ branches/release/libs/thread/test/test_thread_launching.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -5,7 +5,7 @@
#define BOOST_THREAD_VERSION 3
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <boost/test/unit_test.hpp>
#include <boost/ref.hpp>
#include <boost/utility.hpp>
Modified: branches/release/libs/thread/test/test_thread_mf.cpp
==============================================================================
--- branches/release/libs/thread/test/test_thread_mf.cpp (original)
+++ branches/release/libs/thread/test/test_thread_mf.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -7,7 +7,7 @@
//
#define BOOST_THREAD_VERSION 3
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <boost/detail/lightweight_test.hpp>
struct X
Modified: branches/release/libs/thread/test/test_thread_move.cpp
==============================================================================
--- branches/release/libs/thread/test/test_thread_move.cpp (original)
+++ branches/release/libs/thread/test/test_thread_move.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -2,7 +2,7 @@
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <boost/test/unit_test.hpp>
void do_nothing(boost::thread::id* my_id)
Modified: branches/release/libs/thread/test/test_thread_move_return.cpp
==============================================================================
--- branches/release/libs/thread/test/test_thread_move_return.cpp (original)
+++ branches/release/libs/thread/test/test_thread_move_return.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -5,7 +5,7 @@
#define BOOST_THREAD_USES_MOVE
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <boost/test/unit_test.hpp>
void do_nothing(boost::thread::id* my_id)
Modified: branches/release/libs/thread/test/test_thread_return_local.cpp
==============================================================================
--- branches/release/libs/thread/test/test_thread_return_local.cpp (original)
+++ branches/release/libs/thread/test/test_thread_return_local.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -5,7 +5,7 @@
#define BOOST_THREAD_USES_MOVE
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <boost/test/unit_test.hpp>
void do_nothing(boost::thread::id* my_id)
Modified: branches/release/libs/thread/test/threads/this_thread/get_id/get_id_pass.cpp
==============================================================================
--- branches/release/libs/thread/test/threads/this_thread/get_id/get_id_pass.cpp (original)
+++ branches/release/libs/thread/test/threads/this_thread/get_id/get_id_pass.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -15,7 +15,7 @@
// thread::id this_thread::get_id();
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <boost/detail/lightweight_test.hpp>
Modified: branches/release/libs/thread/test/threads/this_thread/sleep_for/sleep_for_pass.cpp
==============================================================================
--- branches/release/libs/thread/test/threads/this_thread/sleep_for/sleep_for_pass.cpp (original)
+++ branches/release/libs/thread/test/threads/this_thread/sleep_for/sleep_for_pass.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -15,7 +15,7 @@
// thread::id this_thread::get_id();
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <cstdlib>
#include <algorithm>
Modified: branches/release/libs/thread/test/threads/this_thread/sleep_until/sleep_until_pass.cpp
==============================================================================
--- branches/release/libs/thread/test/threads/this_thread/sleep_until/sleep_until_pass.cpp (original)
+++ branches/release/libs/thread/test/threads/this_thread/sleep_until/sleep_until_pass.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -15,7 +15,7 @@
// thread::id this_thread::get_id();
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <cstdlib>
#include <algorithm>
Modified: branches/release/libs/thread/test/threads/thread/assign/copy_fail.cpp
==============================================================================
--- branches/release/libs/thread/test/threads/thread/assign/copy_fail.cpp (original)
+++ branches/release/libs/thread/test/threads/thread/assign/copy_fail.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -18,7 +18,7 @@
// thread& operator=(thread&& t);
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <new>
#include <cstdlib>
#include <boost/detail/lightweight_test.hpp>
Modified: branches/release/libs/thread/test/threads/thread/assign/move_pass.cpp
==============================================================================
--- branches/release/libs/thread/test/threads/thread/assign/move_pass.cpp (original)
+++ branches/release/libs/thread/test/threads/thread/assign/move_pass.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -20,7 +20,7 @@
#define BOOST_THREAD_PROVIDES_THREAD_MOVE_ASSIGN_CALLS_TERMINATE_IF_JOINABLE
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <new>
#include <cstdlib>
#include <cassert>
Modified: branches/release/libs/thread/test/threads/thread/constr/FArgs_pass.cpp
==============================================================================
--- branches/release/libs/thread/test/threads/thread/constr/FArgs_pass.cpp (original)
+++ branches/release/libs/thread/test/threads/thread/constr/FArgs_pass.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -20,7 +20,7 @@
#include <new>
#include <cstdlib>
#include <cassert>
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <boost/detail/lightweight_test.hpp>
unsigned throw_one = 0xFFFF;
Modified: branches/release/libs/thread/test/threads/thread/constr/F_pass.cpp
==============================================================================
--- branches/release/libs/thread/test/threads/thread/constr/F_pass.cpp (original)
+++ branches/release/libs/thread/test/threads/thread/constr/F_pass.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -20,7 +20,7 @@
#include <new>
#include <cstdlib>
#include <cassert>
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <boost/detail/lightweight_test.hpp>
unsigned throw_one = 0xFFFF;
Modified: branches/release/libs/thread/test/threads/thread/constr/FrvalueArgs_pass.cpp
==============================================================================
--- branches/release/libs/thread/test/threads/thread/constr/FrvalueArgs_pass.cpp (original)
+++ branches/release/libs/thread/test/threads/thread/constr/FrvalueArgs_pass.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -19,7 +19,7 @@
#define BOOST_THREAD_VERSION 4
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <new>
#include <cstdlib>
#include <cassert>
Modified: branches/release/libs/thread/test/threads/thread/constr/Frvalue_pass.cpp
==============================================================================
--- branches/release/libs/thread/test/threads/thread/constr/Frvalue_pass.cpp (original)
+++ branches/release/libs/thread/test/threads/thread/constr/Frvalue_pass.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -19,7 +19,7 @@
#define BOOST_THREAD_USES_MOVE
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <new>
#include <cstdlib>
#include <cassert>
Modified: branches/release/libs/thread/test/threads/thread/constr/copy_fail.cpp
==============================================================================
--- branches/release/libs/thread/test/threads/thread/constr/copy_fail.cpp (original)
+++ branches/release/libs/thread/test/threads/thread/constr/copy_fail.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -18,7 +18,7 @@
// thread(const thread&) = delete;
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <new>
#include <cstdlib>
#include <boost/detail/lightweight_test.hpp>
Modified: branches/release/libs/thread/test/threads/thread/constr/default_pass.cpp
==============================================================================
--- branches/release/libs/thread/test/threads/thread/constr/default_pass.cpp (original)
+++ branches/release/libs/thread/test/threads/thread/constr/default_pass.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -18,7 +18,7 @@
// thread();
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <cassert>
#include <boost/detail/lightweight_test.hpp>
Modified: branches/release/libs/thread/test/threads/thread/constr/move_pass.cpp
==============================================================================
--- branches/release/libs/thread/test/threads/thread/constr/move_pass.cpp (original)
+++ branches/release/libs/thread/test/threads/thread/constr/move_pass.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -17,7 +17,7 @@
// thread(thread&& t);
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <new>
#include <cstdlib>
#include <boost/detail/lightweight_test.hpp>
Modified: branches/release/libs/thread/test/threads/thread/destr/dtor_pass.cpp
==============================================================================
--- branches/release/libs/thread/test/threads/thread/destr/dtor_pass.cpp (original)
+++ branches/release/libs/thread/test/threads/thread/destr/dtor_pass.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -19,7 +19,7 @@
#define BOOST_THREAD_PROVIDES_THREAD_DESTRUCTOR_CALLS_TERMINATE_IF_JOINABLE
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <new>
#include <cstdlib>
#include <boost/detail/lightweight_test.hpp>
Modified: branches/release/libs/thread/test/threads/thread/id/hash_pass.cpp
==============================================================================
--- branches/release/libs/thread/test/threads/thread/id/hash_pass.cpp (original)
+++ branches/release/libs/thread/test/threads/thread/id/hash_pass.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -23,7 +23,7 @@
// };
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <boost/detail/lightweight_test.hpp>
int main()
Modified: branches/release/libs/thread/test/threads/thread/members/detach_pass.cpp
==============================================================================
--- branches/release/libs/thread/test/threads/thread/members/detach_pass.cpp (original)
+++ branches/release/libs/thread/test/threads/thread/members/detach_pass.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -17,7 +17,7 @@
// void detach();
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <new>
#include <cstdlib>
#include <cassert>
Modified: branches/release/libs/thread/test/threads/thread/members/get_id_pass.cpp
==============================================================================
--- branches/release/libs/thread/test/threads/thread/members/get_id_pass.cpp (original)
+++ branches/release/libs/thread/test/threads/thread/members/get_id_pass.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -17,7 +17,7 @@
// id get_id() const;
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <new>
#include <cstdlib>
#include <cassert>
Modified: branches/release/libs/thread/test/threads/thread/members/join_pass.cpp
==============================================================================
--- branches/release/libs/thread/test/threads/thread/members/join_pass.cpp (original)
+++ branches/release/libs/thread/test/threads/thread/members/join_pass.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -17,7 +17,7 @@
// void join();
#define BOOST_THREAD_VESRION 3
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/thread/locks.hpp>
#include <new>
Modified: branches/release/libs/thread/test/threads/thread/members/joinable_pass.cpp
==============================================================================
--- branches/release/libs/thread/test/threads/thread/members/joinable_pass.cpp (original)
+++ branches/release/libs/thread/test/threads/thread/members/joinable_pass.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -17,7 +17,7 @@
// bool joinable() const;
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <new>
#include <cstdlib>
#include <cassert>
Modified: branches/release/libs/thread/test/threads/thread/members/native_handle_pass.cpp
==============================================================================
--- branches/release/libs/thread/test/threads/thread/members/native_handle_pass.cpp (original)
+++ branches/release/libs/thread/test/threads/thread/members/native_handle_pass.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -17,7 +17,7 @@
// native_handle_type native_handle();
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <new>
#include <cstdlib>
#include <cassert>
@@ -61,7 +61,7 @@
{
{
boost::thread t0( (G()));
- // boost::thread::native_handle_type hdl =
+ // boost::thread::native_handle_type hdl =
(void)t0.native_handle();
t0.join();
}
Modified: branches/release/libs/thread/test/threads/thread/members/swap_pass.cpp
==============================================================================
--- branches/release/libs/thread/test/threads/thread/members/swap_pass.cpp (original)
+++ branches/release/libs/thread/test/threads/thread/members/swap_pass.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -17,7 +17,7 @@
// native_handle_type native_handle();
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <cstdlib>
#include <boost/detail/lightweight_test.hpp>
Modified: branches/release/libs/thread/test/threads/thread/members/try_join_for_pass.cpp
==============================================================================
--- branches/release/libs/thread/test/threads/thread/members/try_join_for_pass.cpp (original)
+++ branches/release/libs/thread/test/threads/thread/members/try_join_for_pass.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -19,7 +19,7 @@
// bool try_join_for(const chrono::duration<Rep, Period>& rel_time);
#define BOOST_THREAD_VESRION 3
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/thread/locks.hpp>
#include <new>
Modified: branches/release/libs/thread/test/threads/thread/members/try_join_until_pass.cpp
==============================================================================
--- branches/release/libs/thread/test/threads/thread/members/try_join_until_pass.cpp (original)
+++ branches/release/libs/thread/test/threads/thread/members/try_join_until_pass.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -19,7 +19,7 @@
// bool try_join_until(const chrono::time_point<Clock, Duration>& t);
#define BOOST_THREAD_VESRION 3
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/thread/locks.hpp>
#include <new>
Modified: branches/release/libs/thread/test/threads/thread/non_members/swap_pass.cpp
==============================================================================
--- branches/release/libs/thread/test/threads/thread/non_members/swap_pass.cpp (original)
+++ branches/release/libs/thread/test/threads/thread/non_members/swap_pass.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -15,7 +15,7 @@
// void swap(thread& x, thread& y);
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <new>
#include <cstdlib>
#include <cassert>
Modified: branches/release/libs/thread/test/threads/thread/static/hardware_concurrency_pass.cpp
==============================================================================
--- branches/release/libs/thread/test/threads/thread/static/hardware_concurrency_pass.cpp (original)
+++ branches/release/libs/thread/test/threads/thread/static/hardware_concurrency_pass.cpp 2013-03-31 06:56:43 EDT (Sun, 31 Mar 2013)
@@ -17,7 +17,7 @@
// static unsigned hardware_concurrency();
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
#include <boost/detail/lightweight_test.hpp>
int main()
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk