unique_lock::try_lock_until 方法
嘗試在不造成封鎖的情況下,取得關聯 mutex 的擁有權。
template<class Clock, class Duration>
bool try_lock_until(const chrono::time_point<Clock, Duration>& Abs_time);
bool try_lock_until(const xtime *Abs_time);
參數
- Abs_time
這個時間點所指定的臨界值一超過,方法就不再嘗試取得 mutex 的擁有權。
傳回值
如果方法成功取得 mutex 的擁有權,就是 true,否則為 false。
備註
如果儲存的 mutex 指標是 null,其具 operation_not_permitted錯誤碼的方法會擲回 system_error 。
如果呼叫的執行緒已經擁有 mutex,具有 resource_deadlock_would_occur錯誤碼的方法會擲回 system_error 。
需求
標題: mutex
命名空間: std