|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r80134 - in trunk: boost/thread/detail libs/thread/src/win32
From: vicente.botet_at_[hidden]
Date: 2012-08-22 02:12:47
Author: viboes
Date: 2012-08-22 02:12:46 EDT (Wed, 22 Aug 2012)
New Revision: 80134
URL: http://svn.boost.org/trac/boost/changeset/80134
Log:
Thread: fix win regression
Text files modified:
trunk/boost/thread/detail/thread.hpp | 37 +++++++++++++++++++------------------
trunk/libs/thread/src/win32/thread.cpp | 23 +++++++++++++++++++++++
2 files changed, 42 insertions(+), 18 deletions(-)
Modified: trunk/boost/thread/detail/thread.hpp
==============================================================================
--- trunk/boost/thread/detail/thread.hpp (original)
+++ trunk/boost/thread/detail/thread.hpp 2012-08-22 02:12:46 EDT (Wed, 22 Aug 2012)
@@ -366,24 +366,25 @@
bool timed_join(const system_time& abs_time);
#ifdef BOOST_THREAD_USES_CHRONO
- bool try_join_until(const chrono::time_point<chrono::system_clock, chrono::nanoseconds>& tp)
- {
- if (this_thread::get_id() == get_id())
- {
- boost::throw_exception(thread_resource_error(system::errc::resource_deadlock_would_occur, "boost thread: trying joining itself"));
- }
- detail::thread_data_ptr local_thread_info=(get_thread_info)();
- if(local_thread_info)
- {
- chrono::milliseconds rel_time= chrono::ceil<chrono::milliseconds>(tp-chrono::system_clock::now());
- if(!this_thread::interruptible_wait(local_thread_info->thread_handle,rel_time.count()))
- {
- return false;
- }
- release_handle();
- }
- return true;
- }
+ bool try_join_until(const chrono::time_point<chrono::system_clock, chrono::nanoseconds>& tp);
+// bool try_join_until(const chrono::time_point<chrono::system_clock, chrono::nanoseconds>& tp)
+// {
+// if (this_thread::get_id() == get_id())
+// {
+// boost::throw_exception(thread_resource_error(system::errc::resource_deadlock_would_occur, "boost thread: trying joining itself"));
+// }
+// detail::thread_data_ptr local_thread_info=(get_thread_info)();
+// if(local_thread_info)
+// {
+// chrono::milliseconds rel_time= chrono::ceil<chrono::milliseconds>(tp-chrono::system_clock::now());
+// if(!this_thread::interruptible_wait(local_thread_info->thread_handle,rel_time.count()))
+// {
+// return false;
+// }
+// release_handle();
+// }
+// return true;
+// }
#endif
public:
Modified: trunk/libs/thread/src/win32/thread.cpp
==============================================================================
--- trunk/libs/thread/src/win32/thread.cpp (original)
+++ trunk/libs/thread/src/win32/thread.cpp 2012-08-22 02:12:46 EDT (Wed, 22 Aug 2012)
@@ -334,6 +334,29 @@
return true;
}
+#ifdef BOOST_THREAD_USES_CHRONO
+
+ bool thread::try_join_until(const chrono::time_point<chrono::system_clock, chrono::nanoseconds>& tp)
+ {
+ if (this_thread::get_id() == get_id())
+ {
+ boost::throw_exception(thread_resource_error(system::errc::resource_deadlock_would_occur, "boost thread: trying joining itself"));
+ }
+ detail::thread_data_ptr local_thread_info=(get_thread_info)();
+ if(local_thread_info)
+ {
+ chrono::milliseconds rel_time= chrono::ceil<chrono::milliseconds>(tp-chrono::system_clock::now());
+ if(!this_thread::interruptible_wait(local_thread_info->thread_handle,rel_time.count()))
+ {
+ return false;
+ }
+ release_handle();
+ }
+ return true;
+ }
+
+#endif
+
void thread::detach() BOOST_NOEXCEPT
{
release_handle();
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