Если this->owns_lock()
true
, то вызывает this->mutex()->unlock()
.Нет.
STD::UNIQUE_LOCK::SWAP
Обменивает владение ассоциированными блокировками мьютекса между двумя объектами std::unique_lock
void swap(unique_lock& other) noexcept;
Если other
*this
. Если *this
владел блокировкой мьютекса до вызова, то теперь этой блокировкой владеет other
.this.mutex()
other.mutex()
до вызова, other.mutex()
равно значению this.mutex()
до вызова, this.owns_lock()
равно значению other.owns_lock()
до вызова, other.owns_lock()
равно значению this.owns_lock()
до вызова.Нет.
STD::SWAP
Обменивает владение ассоциированными блокировками мьютекса между двумя объектами std::unique_lock
void swap(unique_lock& lhs, unique_lock& rhs) noexcept;
lhs.swap(rhs)
Нет.
STD::UNIQUE_LOCK::LOCK
Захватывает мьютекс, ассоциированный с *this
void lock();
this->mutex() != NULL
this->owns_lock() == false
.Вызывает this->mutex()->lock()
Любое исключение, возбужденное this->mutex()->lock()
std::system_error
с кодом ошибки std::errc::operation_not_permitted
, если this->mutex() == NULL
. Исключение типа std::system_error
с кодом ошибки std::errc::resource_deadlock_would_occur
, если this->owns_lock() == true
в момент вызова.this->owns_lock() == true
STD::UNIQUE_LOCK::TRY_LOCK
Пытается захватить мьютекс, ассоциированный с *this
bool try_lock();
Тип Mutex
std::unique_lock
, должен удовлетворять требованиям концепции Lockable
. this->mutex() != NULL
, this->owns_lock() == false
.Вызывает this->mutex ()->try_lock()
true
this->mutex()->try_lock()
вернул true
, иначе false
.Любое исключение, возбужденное this->mutex()->try_lock()
std::system_error
с кодом ошибки std::errc::operation_not_permitted
, если this->mutex() == NULL
. Исключение типа std::system_error
с кодом ошибки std::errc::resource_deadlock_would_occur
, если this->owns_lock() == true
в момент вызова.Если функция возвращает true
this->owns_lock() == true
, иначе this->owns_lock() == false
.STD::UNIQUE_LOCK::UNLOCK
Освобождает мьютекс, ассоциированный с *this
void unlock();
this->mutex() != NULL
this->owns_lock() == true
.Вызывает this->mutex()->unlock()
Любое исключение, возбужденное this->mutex()->unlock()
std::system_error
с кодом ошибки std::errc::operation_not_permitted
, если this->owns_lock() == false
в момент вызова.this->owns_lock() == false
STD::UNIQUE_LOCK::TRY_LOCK_FOR
Пытается захватить мьютекс, ассоциированный с *this
template
bool try_lock_for(
std::chrono::duration