/// Attempts to acquire ownership of the \a recursive_mutex. /// Never blocks. /// /// \returns \a true if ownership was acquired; otherwise, \a false. /// /// \throws Never throws. bool try_lock() { thread_id_type const id = thread_id_from_mutex<Mutex>::call(); HPX_ASSERT(id != thread_id_from_mutex<Mutex>::invalid_id()); return try_recursive_lock(id) || try_basic_lock(id); }
bool recursive_mutex::try_lock() { threads::thread_id_type const current_thread_id = threads::get_self_id(); return try_recursive_lock(current_thread_id) || try_basic_lock(current_thread_id); }
bool try_lock() { long const current_thread_id=win32::GetCurrentThreadId(); return try_recursive_lock(current_thread_id) || try_basic_lock(current_thread_id); }