2
0
mirror of https://github.com/boostorg/thread.git synced 2026-02-12 12:32:10 +00:00
[SVN r43162]
This commit is contained in:
Daniel James
2008-02-07 18:54:14 +00:00
parent f934c01bdf
commit 43943faf5c
3 changed files with 23 additions and 0 deletions

View File

@@ -56,6 +56,12 @@ namespace boost
long const current_thread_id=win32::GetCurrentThreadId();
return try_recursive_lock(current_thread_id) || try_timed_lock(current_thread_id,target);
}
template<typename Duration>
bool timed_lock(Duration const& timeout)
{
return timed_lock(get_system_time()+timeout);
}
long get_active_count()
{
return mutex.get_active_count();

View File

@@ -104,6 +104,12 @@ namespace boost
return true;
}
template<typename Duration>
bool timed_lock(Duration const& timeout)
{
return timed_lock(get_system_time()+timeout);
}
long get_active_count()
{
return ::boost::detail::interlocked_read_acquire(&active_count);