Changeset 78802
- Timestamp:
- Jun 3, 2012, 6:11:52 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 32 edited
-
boost/thread/detail/config.hpp (modified) (1 diff)
-
boost/thread/detail/delete.hpp (modified) (2 diffs)
-
boost/thread/future.hpp (modified) (2 diffs)
-
boost/thread/locks.hpp (modified) (1 diff)
-
boost/thread/xtime.hpp (modified) (6 diffs)
-
libs/thread/build/Jamfile.v2 (modified) (3 diffs)
-
libs/thread/doc/changes.qbk (modified) (2 diffs)
-
libs/thread/doc/emulations.qbk (modified) (1 diff)
-
libs/thread/doc/mutex_concepts.qbk (modified) (1 diff)
-
libs/thread/example/starvephil.cpp (modified) (3 diffs)
-
libs/thread/example/tennis.cpp (modified) (2 diffs)
-
libs/thread/example/thread.cpp (modified) (1 diff)
-
libs/thread/example/xtime.cpp (modified) (1 diff)
-
libs/thread/src/pthread/thread.cpp (modified) (3 diffs)
-
libs/thread/src/pthread/timeconv.inl (modified) (4 diffs)
-
libs/thread/src/win32/thread.cpp (modified) (1 diff)
-
libs/thread/src/win32/timeconv.inl (modified) (4 diffs)
-
libs/thread/test/sync/futures/async/async_pass.cpp (modified) (4 diffs)
-
libs/thread/test/test_condition_notify_all.cpp (modified) (1 diff)
-
libs/thread/test/test_condition_notify_one.cpp (modified) (1 diff)
-
libs/thread/test/test_condition_timed_wait_times_out.cpp (modified) (1 diff)
-
libs/thread/test/test_futures.cpp (modified) (1 diff)
-
libs/thread/test/test_ml.cpp (modified) (2 diffs)
-
libs/thread/test/test_shared_mutex.cpp (modified) (1 diff)
-
libs/thread/test/test_shared_mutex_part_2.cpp (modified) (1 diff)
-
libs/thread/test/test_shared_mutex_timed_locks.cpp (modified) (1 diff)
-
libs/thread/test/test_shared_mutex_timed_locks_chrono.cpp (modified) (1 diff)
-
libs/thread/test/test_thread_exit.cpp (modified) (1 diff)
-
libs/thread/test/test_xtime.cpp (modified) (3 diffs)
-
libs/thread/test/threads/this_thread/sleep_for/sleep_for_pass.cpp (modified) (2 diffs)
-
libs/thread/test/threads/this_thread/sleep_until/sleep_until_pass.cpp (modified) (2 diffs)
-
libs/thread/test/util.inl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/boost/thread/detail/config.hpp
r78226 r78802 132 132 #endif 133 133 134 #include "platform.hpp"134 #include <boost/thread/detail/platform.hpp> 135 135 136 136 // provided for backwards compatibility, since this -
trunk/boost/thread/detail/delete.hpp
r78139 r78802 9 9 #include <boost/config.hpp> 10 10 11 /** 12 * BOOST_THREAD_DELETE_COPY_CTOR deletes the copy constructor when the compiler supports it or 13 * makes it private. 14 * 15 * BOOST_THREAD_DELETE_COPY_ASSIGN deletes the copy assignment when the compiler supports it or 16 * makes it private. 17 */ 11 18 #ifndef BOOST_NO_DELETED_FUNCTIONS 12 19 #define BOOST_THREAD_DELETE_COPY_CTOR(CLASS) \ … … 28 35 #endif // BOOST_NO_DELETED_FUNCTIONS 29 36 37 /** 38 * BOOST_THREAD_NO_COPYABLE deletes the copy constructor and assignment when the compiler supports it or 39 * makes them private. 40 */ 30 41 #define BOOST_THREAD_NO_COPYABLE(CLASS) \ 31 42 BOOST_THREAD_DELETE_COPY_CTOR(CLASS) \ -
trunk/boost/thread/future.hpp
r78407 r78802 44 44 #endif 45 45 46 #include <boost/utility/result_of.hpp> 47 //#include <boost/thread.hpp> 48 46 49 #if defined BOOST_THREAD_PROVIDES_FUTURE 47 50 #define BOOST_THREAD_FUTURE future … … 1656 1659 BOOST_THREAD_DCL_MOVABLE_BEG(T) packaged_task<T> BOOST_THREAD_DCL_MOVABLE_END 1657 1660 1661 // template <class F> 1662 // BOOST_THREAD_FUTURE<typename boost::result_of<F()>::type> 1663 // async(launch policy, F f) 1664 // { 1665 // typedef typename boost::result_of<F()>::type R; 1666 // typedef BOOST_THREAD_FUTURE<R> future; 1667 // if (int(policy) & int(launch::async)) 1668 // { 1669 // packaged_task<R> pt( f ); 1670 // 1671 // BOOST_THREAD_FUTURE ret = pt.get_future(); 1672 // boost::thread( boost::move(pt) ).detach(); 1673 // return ::boost::move(ret); 1674 // } 1675 // else if (int(policy) & int(launch::deferred)) 1676 // { 1677 // packaged_task<R> pt( f ); 1678 // 1679 // BOOST_THREAD_FUTURE ret = pt.get_future(); 1680 // return ::boost::move(ret); 1681 // } 1682 // } 1683 // 1684 // template <class F> 1685 // BOOST_THREAD_FUTURE<typename boost::result_of<F()>::type> 1686 // async(F f) 1687 // { 1688 // return async(launch::any, f); 1689 // } 1690 1691 1658 1692 1659 1693 } -
trunk/boost/thread/locks.hpp
r78139 r78802 171 171 {}; 172 172 173 constdefer_lock_t defer_lock={};174 consttry_to_lock_t try_to_lock={};175 constadopt_lock_t adopt_lock={};173 BOOST_CONSTEXPR_OR_CONST defer_lock_t defer_lock={}; 174 BOOST_CONSTEXPR_OR_CONST try_to_lock_t try_to_lock={}; 175 BOOST_CONSTEXPR_OR_CONST adopt_lock_t adopt_lock={}; 176 176 177 177 template<typename Mutex> -
trunk/boost/thread/xtime.hpp
r46124 r78802 3 3 // Copyright (C) 2007-8 Anthony Williams 4 4 // 5 // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 // Distributed under the Boost Software License, Version 1.0. (See accompanying 6 6 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 7 … … 21 21 enum xtime_clock_types 22 22 { 23 TIME_UTC =123 TIME_UTC_=1 24 24 // TIME_TAI, 25 25 // TIME_MONOTONIC, … … 54 54 #endif 55 55 } 56 56 57 57 }; 58 58 … … 61 61 xtime res; 62 62 boost::posix_time::time_duration const time_since_epoch=abs_time-boost::posix_time::from_time_t(0); 63 63 64 64 res.sec=static_cast<xtime::xtime_sec_t>(time_since_epoch.total_seconds()); 65 65 res.nsec=static_cast<xtime::xtime_nsec_t>(time_since_epoch.fractional_seconds()*(1000000000/time_since_epoch.ticks_per_second())); … … 69 69 inline int xtime_get(struct xtime* xtp, int clock_type) 70 70 { 71 if (clock_type == TIME_UTC )71 if (clock_type == TIME_UTC_) 72 72 { 73 73 *xtp=get_xtime(get_system_time()); … … 82 82 if (xt1.sec == xt2.sec) 83 83 return (int)(xt1.nsec - xt2.nsec); 84 else 84 else 85 85 return (xt1.sec > xt2.sec) ? 1 : -1; 86 86 } -
trunk/libs/thread/build/Jamfile.v2
r78451 r78802 41 41 : source-location ../src 42 42 : requirements <threading>multi 43 <link>static:<define>BOOST_THREAD_ BUILD_LIB=144 <link>shared:<define>BOOST_THREAD_ BUILD_DLL=143 <link>static:<define>BOOST_THREAD_STATIC_LINK=1 44 <link>shared:<define>BOOST_THREAD_DYN_LINK=1 45 45 -<tag>@$(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).tag 46 46 <tag>@$(__name__).tag … … 93 93 # : default-build <threading>multi 94 94 : usage-requirements # pass these requirement to dependents (i.e. users) 95 <link>static:<define>BOOST_THREAD_ BUILD_LIB=196 <link>shared:<define>BOOST_THREAD_ BUILD_DLL=195 <link>static:<define>BOOST_THREAD_STATIC_LINK=1 96 <link>shared:<define>BOOST_THREAD_DYN_LINK=1 97 97 <define>BOOST_SYSTEM_NO_DEPRECATED 98 98 <library>/boost/system//boost_system … … 264 264 : <conditional>@requirements 265 265 : 266 : <link>shared:<define>BOOST_THREAD_USE_DLL=1267 <link>static:<define>BOOST_THREAD_USE_LIB=1266 : #<link>shared:<define>BOOST_THREAD_USE_DLL=1 267 #<link>static:<define>BOOST_THREAD_USE_LIB=1 268 268 <conditional>@usage-requirements 269 269 ; -
trunk/libs/thread/doc/changes.qbk
r78029 r78802 21 21 * [@http://svn.boost.org/trac/boost/ticket/6217 #6217] Enhance Boost.Thread shared mutex interface following Howard Hinnant proposal. 22 22 * [@http://svn.boost.org/trac/boost/ticket/6224 #6224] c++11 compliance: Add the use of standard noexcept on compilers supporting them. 23 * [@http://svn.boost.org/trac/boost/ticket/6225 #6225] Add the use of standard =delete defaulted operations on compilers supporting them. 23 24 * [@http://svn.boost.org/trac/boost/ticket/6226 #6226] c++11 compliance: Add explicit bool conversion from locks. 24 25 * [@http://svn.boost.org/trac/boost/ticket/6228 #6228] Add promise constructor with allocator following the standard c++11. 26 * [@http://svn.boost.org/trac/boost/ticket/6229 #6229] Rename the unique_future to future following the c++11. 25 27 * [@http://svn.boost.org/trac/boost/ticket/6230 #6230] c++11 compliance: Follows the exception reporting mechanism as defined in the c++11. 28 * [@http://svn.boost.org/trac/boost/ticket/6231 #6231] Add BasicLockable requirements in the documentation to follow c++11. 26 29 * [@http://svn.boost.org/trac/boost/ticket/6266 #6266] Breaking change: thread destructor should call terminate if joinable. 27 30 * [@http://svn.boost.org/trac/boost/ticket/6269 #6269] Breaking change: thread move assignment should call terminate if joinable. 28 31 * [@http://svn.boost.org/trac/boost/ticket/6272 #6272] c++11 compliance: Add thread::id hash specialization. 29 32 * [@http://svn.boost.org/trac/boost/ticket/6273 #6273] c++11 compliance: Add cv_status enum class and use it on the conditions wait functions. 30 * [@http://svn.boost.org/trac/boost/ticket/6231 #6231] Add BasicLockable requirements in the documentation to follow c++11.31 33 * [@http://svn.boost.org/trac/boost/ticket/6342 #6342] c++11 compliance: Adapt the one_flag to the c++11 interface. 32 34 * [@http://svn.boost.org/trac/boost/ticket/6671 #6671] upgrade_lock: missing mutex and release functions. 33 35 * [@http://svn.boost.org/trac/boost/ticket/6672 #6672] upgrade_lock:: missing constructors from time related types. 34 36 * [@http://svn.boost.org/trac/boost/ticket/6675 #6675] upgrade_lock:: missing non-member swap. 37 * [@http://svn.boost.org/trac/boost/ticket/6676 #6676] lock conversion should be explicit. 35 38 * Added missing packaged_task::result_type and packaged_task:: constructor with allocator. 36 39 * Added packaged_task::reset() 37 40 41 38 42 Fixed Bugs: 39 43 44 * [@http://svn.boost.org/trac/boost/ticket/2380 #2380] boost::move from lvalue does not work with gcc. 45 * [@http://svn.boost.org/trac/boost/ticket/2430 #2430] shared_mutex for win32 doesn't have timed_lock_upgrade. 40 46 * [@http://svn.boost.org/trac/boost/ticket/2575 #2575] Bug- Boost 1.36.0 on Itanium platform. 47 * [@http://svn.boost.org/trac/boost/ticket/3160 #3160] Duplicate tutorial code in boost::thread. 41 48 * [@http://svn.boost.org/trac/boost/ticket/4345 #4345] thread::id and joining problem with cascade of threads. 49 * [@http://svn.boost.org/trac/boost/ticket/4521 #4521] Error using boost::move on packaged_task (MSVC 10). 50 * [@http://svn.boost.org/trac/boost/ticket/4711 #4711] Must use implementation details to return move-only types. 42 51 * [@http://svn.boost.org/trac/boost/ticket/4921 #4921] BOOST_THREAD_USE_DLL and BOOST_THREAD_USE_LIB are crucial and need to be documented. 43 52 * [@http://svn.boost.org/trac/boost/ticket/5013 #5013] documentation: boost::thread: pthreas_exit causes terminate(). … … 48 57 * [@http://svn.boost.org/trac/boost/ticket/6174 #6174] packaged_task doesn't correctly handle moving results. 49 58 * [@http://svn.boost.org/trac/boost/ticket/6222 #6222] Compile error with SunStudio: unique_future move. 59 * [@http://svn.boost.org/trac/boost/ticket/6354 #6354] PGI: Compiler threading support is not turned on. 50 60 * [@http://svn.boost.org/trac/boost/ticket/6673 #6673] shared_lock: move assign doesn't works with c++11. 51 61 * [@http://svn.boost.org/trac/boost/ticket/6674 #6674] shared_mutex: try_lock_upgrade_until doesn't works. -
trunk/libs/thread/doc/emulations.qbk
r78123 r78802 341 341 use 342 342 343 switch ( BOOST_SCOPED_ENUM_NATIVE(future_errc)(ev))343 switch (boost::native_value(ev)) 344 344 { 345 345 case future_errc::broken_promise: -
trunk/libs/thread/doc/mutex_concepts.qbk
r78029 r78802 796 796 struct try_to_lock_t {}; 797 797 struct adopt_lock_t {}; 798 const defer_lock_t defer_lock;799 const try_to_lock_t try_to_lock;800 const adopt_lock_t adopt_lock;798 constexpr defer_lock_t defer_lock; 799 constexpr try_to_lock_t try_to_lock; 800 constexpr adopt_lock_t adopt_lock; 801 801 802 802 template<typename Lockable> -
trunk/libs/thread/example/starvephil.cpp
r77918 r78802 51 51 } 52 52 boost::xtime xt; 53 boost::xtime_get(&xt, boost::TIME_UTC );53 boost::xtime_get(&xt, boost::TIME_UTC_); 54 54 xt.sec += 3; 55 55 boost::thread::sleep(xt); … … 86 86 } 87 87 boost::xtime xt; 88 boost::xtime_get(&xt, boost::TIME_UTC );88 boost::xtime_get(&xt, boost::TIME_UTC_); 89 89 xt.sec += 2; 90 90 boost::thread::sleep(xt); … … 112 112 { 113 113 boost::xtime xt; 114 boost::xtime_get(&xt, boost::TIME_UTC );114 boost::xtime_get(&xt, boost::TIME_UTC_); 115 115 xt.sec += 3; 116 116 boost::thread::sleep(xt); -
trunk/libs/thread/example/tennis.cpp
r49978 r78802 2 2 // William E. Kempf 3 3 // 4 // Distributed under the Boost Software License, Version 1.0. (See accompanying 4 // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 5 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 6 … … 105 105 106 106 boost::xtime xt; 107 boost::xtime_get(&xt, boost::TIME_UTC );107 boost::xtime_get(&xt, boost::TIME_UTC_); 108 108 xt.sec += 1; 109 109 boost::thread::sleep(xt); -
trunk/libs/thread/example/thread.cpp
r77918 r78802 15 15 { 16 16 boost::xtime xt; 17 boost::xtime_get(&xt, boost::TIME_UTC );17 boost::xtime_get(&xt, boost::TIME_UTC_); 18 18 xt.sec += m_secs; 19 19 -
trunk/libs/thread/example/xtime.cpp
r77918 r78802 11 11 { 12 12 boost::xtime xt; 13 boost::xtime_get(&xt, boost::TIME_UTC );13 boost::xtime_get(&xt, boost::TIME_UTC_); 14 14 xt.sec += 1; 15 15 boost::thread::sleep(xt); // Sleep for 1 second -
trunk/libs/thread/src/pthread/thread.cpp
r77849 r78802 25 25 #endif 26 26 27 #include "timeconv.inl"27 #include <libs/thread/src/pthread/timeconv.inl> 28 28 29 29 namespace boost … … 417 417 # endif 418 418 xtime cur; 419 xtime_get(&cur, TIME_UTC );419 xtime_get(&cur, TIME_UTC_); 420 420 if (xtime_cmp(xt, cur) <= 0) 421 421 return; … … 459 459 # else 460 460 xtime xt; 461 xtime_get(&xt, TIME_UTC );461 xtime_get(&xt, TIME_UTC_); 462 462 sleep(xt); 463 463 # endif -
trunk/libs/thread/src/pthread/timeconv.inl
r75785 r78802 21 21 { 22 22 int res = 0; 23 res = boost::xtime_get(&xt, boost::TIME_UTC );24 BOOST_ASSERT(res == boost::TIME_UTC ); (void)res;23 res = boost::xtime_get(&xt, boost::TIME_UTC_); 24 BOOST_ASSERT(res == boost::TIME_UTC_); (void)res; 25 25 26 26 xt.sec += (milliseconds / MILLISECONDS_PER_SECOND); … … 57 57 boost::xtime cur; 58 58 int res = 0; 59 res = boost::xtime_get(&cur, boost::TIME_UTC );60 BOOST_ASSERT(res == boost::TIME_UTC ); (void)res;59 res = boost::xtime_get(&cur, boost::TIME_UTC_); 60 BOOST_ASSERT(res == boost::TIME_UTC_); (void)res; 61 61 62 62 if (boost::xtime_cmp(xt, cur) <= 0) … … 88 88 boost::xtime cur; 89 89 int res = 0; 90 res = boost::xtime_get(&cur, boost::TIME_UTC );91 BOOST_ASSERT(res == boost::TIME_UTC ); (void)res;90 res = boost::xtime_get(&cur, boost::TIME_UTC_); 91 BOOST_ASSERT(res == boost::TIME_UTC_); (void)res; 92 92 93 93 if (boost::xtime_cmp(xt, cur) <= 0) … … 110 110 boost::xtime cur; 111 111 int res = 0; 112 res = boost::xtime_get(&cur, boost::TIME_UTC );113 BOOST_ASSERT(res == boost::TIME_UTC ); (void)res;112 res = boost::xtime_get(&cur, boost::TIME_UTC_); 113 BOOST_ASSERT(res == boost::TIME_UTC_); (void)res; 114 114 115 115 if (boost::xtime_cmp(xt, cur) <= 0) -
trunk/libs/thread/src/win32/thread.cpp
r78275 r78802 5 5 // (C) Copyright 2007 David Deakins 6 6 7 #ifndef _WIN32_WINNT 7 8 #define _WIN32_WINNT 0x400 9 #endif 10 11 #ifndef WINVER 8 12 #define WINVER 0x400 13 #endif 9 14 10 15 #include <boost/thread/thread.hpp> -
trunk/libs/thread/src/win32/timeconv.inl
r40348 r78802 18 18 { 19 19 int res = 0; 20 res = boost::xtime_get(&xt, boost::TIME_UTC );21 assert(res == boost::TIME_UTC );20 res = boost::xtime_get(&xt, boost::TIME_UTC_); 21 assert(res == boost::TIME_UTC_); 22 22 23 23 xt.sec += (milliseconds / MILLISECONDS_PER_SECOND); … … 55 55 boost::xtime cur; 56 56 int res = 0; 57 res = boost::xtime_get(&cur, boost::TIME_UTC );58 assert(res == boost::TIME_UTC );57 res = boost::xtime_get(&cur, boost::TIME_UTC_); 58 assert(res == boost::TIME_UTC_); 59 59 60 60 if (boost::xtime_cmp(xt, cur) <= 0) … … 86 86 boost::xtime cur; 87 87 int res = 0; 88 res = boost::xtime_get(&cur, boost::TIME_UTC );89 assert(res == boost::TIME_UTC );88 res = boost::xtime_get(&cur, boost::TIME_UTC_); 89 assert(res == boost::TIME_UTC_); 90 90 91 91 if (boost::xtime_cmp(xt, cur) <= 0) … … 108 108 boost::xtime cur; 109 109 int res = 0; 110 res = boost::xtime_get(&cur, boost::TIME_UTC );111 assert(res == boost::TIME_UTC );110 res = boost::xtime_get(&cur, boost::TIME_UTC_); 111 assert(res == boost::TIME_UTC_); 112 112 113 113 if (boost::xtime_cmp(xt, cur) <= 0) -
trunk/libs/thread/test/sync/futures/async/async_pass.cpp
r76295 r78802 25 25 26 26 #include <boost/thread/future.hpp> 27 #include <boost/thread/thread.hpp> 28 #include <boost/interprocess/smart_ptr/unique_ptr.hpp> 27 29 #include <memory> 28 30 #include <boost/detail/lightweight_test.hpp> … … 50 52 } 51 53 52 boost:: unique_ptr<int> f3(int i)54 boost::interprocess::unique_ptr<int> f3(int i) 53 55 { 54 56 boost::this_thread::sleep_for(ms(200)); 55 return boost:: unique_ptr<int>(new int(i));57 return boost::interprocess::unique_ptr<int>(new int(i)); 56 58 } 57 59 58 boost:: unique_ptr<int> f4(boost::unique_ptr<int>&& p)60 boost::interprocess::unique_ptr<int> f4(boost::interprocess::unique_ptr<int>&& p) 59 61 { 60 62 boost::this_thread::sleep_for(ms(200)); … … 164 166 165 167 { 166 boost::future<boost:: unique_ptr<int>> f = boost::async(f3, 3);168 boost::future<boost::interprocess::unique_ptr<int>> f = boost::async(f3, 3); 167 169 boost::this_thread::sleep_for(ms(300)); 168 170 Clock::time_point t0 = Clock::now(); … … 173 175 174 176 { 175 boost::future<boost:: unique_ptr<int>> f = boost::async(f4, boost::unique_ptr<int>(new int(3)));177 boost::future<boost::interprocess::unique_ptr<int>> f = boost::async(f4, boost::interprocess::unique_ptr<int>(new int(3))); 176 178 boost::this_thread::sleep_for(ms(300)); 177 179 Clock::time_point t0 = Clock::now(); -
trunk/libs/thread/test/test_condition_notify_all.cpp
r77849 r78802 11 11 12 12 #include <libs/thread/test/util.inl> 13 #include "condition_test_common.hpp"13 #include <libs/thread/test/condition_test_common.hpp> 14 14 15 15 unsigned const number_of_test_threads=5; -
trunk/libs/thread/test/test_condition_notify_one.cpp
r77849 r78802 11 11 12 12 #include <libs/thread/test/util.inl> 13 #include "condition_test_common.hpp"13 #include <libs/thread/test/condition_test_common.hpp> 14 14 15 15 void do_test_condition_notify_one_wakes_from_wait() -
trunk/libs/thread/test/test_condition_timed_wait_times_out.cpp
r77849 r78802 10 10 11 11 #include <boost/test/unit_test.hpp> 12 #include "util.inl"12 #include <libs/thread/test/util.inl> 13 13 14 14 bool fake_predicate() -
trunk/libs/thread/test/test_futures.cpp
r78243 r78802 5 5 // http://www.boost.org/LICENSE_1_0.txt) 6 6 7 #include "boost/thread/thread.hpp"8 #include "boost/thread/mutex.hpp"9 #include "boost/thread/condition.hpp"10 #include "boost/thread/future.hpp"7 #include <boost/thread/thread.hpp> 8 #include <boost/thread/mutex.hpp> 9 #include <boost/thread/condition.hpp> 10 #include <boost/thread/future.hpp> 11 11 #include <utility> 12 12 #include <memory> -
trunk/libs/thread/test/test_ml.cpp
r77870 r78802 3 3 4 4 #include <boost/detail/lightweight_test.hpp> 5 #include "boost/thread/future.hpp"6 #include "boost/utility/result_of.hpp"5 #include <boost/thread/future.hpp> 6 #include <boost/utility/result_of.hpp> 7 7 #include <functional> 8 8 … … 117 117 /* 118 118 * 119 * #include "boost/test/unit_test.hpp"120 #include "boost/thread/future.hpp"121 #include "boost/utility/result_of.hpp"119 * #include <boost/test/unit_test.hpp> 120 #include <boost/thread/future.hpp> 121 #include <boost/utility/result_of.hpp> 122 122 #include <functional> 123 123 -
trunk/libs/thread/test/test_shared_mutex.cpp
r77849 r78802 7 7 #include <boost/thread/thread.hpp> 8 8 #include <boost/thread/xtime.hpp> 9 #include "util.inl"10 #include "shared_mutex_locking_thread.hpp"9 #include <libs/thread/test/util.inl> 10 #include <libs/thread/test/shared_mutex_locking_thread.hpp> 11 11 12 12 #define CHECK_LOCKED_VALUE_EQUAL(mutex_name,value,expected_value) \ -
trunk/libs/thread/test/test_shared_mutex_part_2.cpp
r77849 r78802 7 7 #include <boost/thread/thread.hpp> 8 8 #include <boost/thread/xtime.hpp> 9 #include "util.inl"10 #include "shared_mutex_locking_thread.hpp"9 #include <libs/thread/test/util.inl> 10 #include <libs/thread/test/shared_mutex_locking_thread.hpp> 11 11 12 12 #define CHECK_LOCKED_VALUE_EQUAL(mutex_name,value,expected_value) \ -
trunk/libs/thread/test/test_shared_mutex_timed_locks.cpp
r77849 r78802 7 7 #include <boost/thread/thread.hpp> 8 8 #include <boost/thread/xtime.hpp> 9 #include "util.inl"10 #include "shared_mutex_locking_thread.hpp"9 #include <libs/thread/test/util.inl> 10 #include <libs/thread/test/shared_mutex_locking_thread.hpp> 11 11 12 12 #define CHECK_LOCKED_VALUE_EQUAL(mutex_name,value,expected_value) \ -
trunk/libs/thread/test/test_shared_mutex_timed_locks_chrono.cpp
r77849 r78802 7 7 #include <boost/thread/thread.hpp> 8 8 #include <boost/thread/shared_mutex.hpp> 9 #include "util.inl"10 #include "shared_mutex_locking_thread.hpp"9 #include <libs/thread/test/util.inl> 10 #include <libs/thread/test/shared_mutex_locking_thread.hpp> 11 11 12 12 #if defined BOOST_THREAD_USES_CHRONO -
trunk/libs/thread/test/test_thread_exit.cpp
r77849 r78802 5 5 // http://www.boost.org/LICENSE_1_0.txt) 6 6 7 #include "boost/thread/thread.hpp"8 #include "boost/thread/mutex.hpp"9 #include "boost/thread/condition.hpp"10 #include "boost/thread/future.hpp"7 #include <boost/thread/thread.hpp> 8 #include <boost/thread/mutex.hpp> 9 #include <boost/thread/condition.hpp> 10 #include <boost/thread/future.hpp> 11 11 #include <utility> 12 12 #include <memory> -
trunk/libs/thread/test/test_xtime.cpp
r77849 r78802 18 18 boost::xtime xt1, xt2, cur; 19 19 BOOST_CHECK_EQUAL( 20 boost::xtime_get(&cur, boost::TIME_UTC ),21 static_cast<int>(boost::TIME_UTC ));20 boost::xtime_get(&cur, boost::TIME_UTC_), 21 static_cast<int>(boost::TIME_UTC_)); 22 22 23 23 xt1 = xt2 = cur; … … 43 43 BOOST_CHECK_EQUAL( 44 44 boost::xtime_get(&orig, 45 boost::TIME_UTC ), static_cast<int>(boost::TIME_UTC));45 boost::TIME_UTC_), static_cast<int>(boost::TIME_UTC_)); 46 46 old = orig; 47 47 … … 49 49 { 50 50 BOOST_CHECK_EQUAL( 51 boost::xtime_get(&cur, boost::TIME_UTC ),52 static_cast<int>(boost::TIME_UTC ));51 boost::xtime_get(&cur, boost::TIME_UTC_), 52 static_cast<int>(boost::TIME_UTC_)); 53 53 BOOST_CHECK(boost::xtime_cmp(cur, orig) >= 0); 54 54 BOOST_CHECK(boost::xtime_cmp(cur, old) >= 0); -
trunk/libs/thread/test/threads/this_thread/sleep_for/sleep_for_pass.cpp
r77041 r78802 18 18 #include <boost/thread/thread.hpp> 19 19 #include <cstdlib> 20 #include <algorithm> 20 21 21 22 #include <boost/detail/lightweight_test.hpp> … … 36 37 // The time slept is within 1% of 500ms 37 38 // This test is spurious as it depends on the time the thread system switches the threads 38 BOOST_TEST(std::abs(static_cast<long>(ns.count())) < (err+boost::chrono::milliseconds(1000)).count()); 39 BOOST_TEST(std::max(ns.count(), -ns.count()) < (err+boost::chrono::milliseconds(1000)).count()); 40 //BOOST_TEST(std::abs(static_cast<long>(ns.count())) < (err+boost::chrono::milliseconds(1000)).count()); 39 41 return boost::report_errors(); 40 42 -
trunk/libs/thread/test/threads/this_thread/sleep_until/sleep_until_pass.cpp
r77041 r78802 18 18 #include <boost/thread/thread.hpp> 19 19 #include <cstdlib> 20 #include <algorithm> 20 21 21 22 #include <boost/detail/lightweight_test.hpp> … … 36 37 // The time slept is within 1% of 500ms 37 38 // This test is spurious as it depends on the time the thread system switches the threads 38 BOOST_TEST(std::abs(static_cast<long>(ns.count())) < (err+boost::chrono::milliseconds(1000)).count()); 39 BOOST_TEST(std::max(ns.count(), -ns.count()) < (err+boost::chrono::milliseconds(1000)).count()); 40 //BOOST_TEST(std::abs(static_cast<long>(ns.count())) < (err+boost::chrono::milliseconds(1000)).count()); 41 return boost::report_errors(); 39 42 40 43 } -
trunk/libs/thread/test/util.inl
r77849 r78802 31 31 32 32 boost::xtime xt; 33 if (boost::TIME_UTC != boost::xtime_get (&xt, boost::TIME_UTC))34 BOOST_ERROR ("boost::xtime_get != boost::TIME_UTC ");33 if (boost::TIME_UTC_ != boost::xtime_get (&xt, boost::TIME_UTC_)) 34 BOOST_ERROR ("boost::xtime_get != boost::TIME_UTC_"); 35 35 36 36 nsecs += xt.nsec;
Note: See TracChangeset
for help on using the changeset viewer.
