2
0
mirror of https://github.com/boostorg/thread.git synced 2026-02-09 23:42:18 +00:00

Thread: fix win regression

[SVN r80134]
This commit is contained in:
Vicente J. Botet Escriba
2012-08-22 06:12:46 +00:00
parent 050b43757f
commit a01faf1bb8
2 changed files with 42 additions and 18 deletions

View File

@@ -334,6 +334,29 @@ namespace boost
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();