![]() |
boost::sync::unique_lock — A unique lock scope guard.
// In header: <boost/sync/locks/unique_lock.hpp> template<typename Mutex> class unique_lock { public: // types typedef Mutex mutex_type; // construct/copy/destruct unique_lock() noexcept; explicit unique_lock(mutex_type &); unique_lock(mutex_type &, adopt_lock_t) noexcept; unique_lock(mutex_type &, defer_lock_t) noexcept; unique_lock(mutex_type &, try_to_lock_t); template<typename Time> unique_lock(unspecified, Time const &); unique_lock(unique_lock &&) noexcept; explicit unique_lock(upgrade_lock< mutex_type > &&); unique_lock(upgrade_lock< mutex_type > &&, try_to_lock_t); unique_lock(shared_lock< mutex_type > &&, try_to_lock_t); template<typename Time> unique_lock(shared_lock< mutex_type > &&, Time const &, unspecified = 0); unique_lock & operator=(unique_lock &&) noexcept; unique_lock & operator=(upgrade_lock< mutex_type > &&); ~unique_lock(); // public member functions void lock(); bool try_lock(); template<typename Time> unspecified timed_lock(Time const &); template<typename Duration> unspecified try_lock_for(Duration const &); template<typename TimePoint> unspecified try_lock_until(TimePoint const &); void unlock(); explicit operator bool() const; bool operator!() const noexcept; bool owns_lock() const noexcept; mutex_type * mutex() const noexcept; mutex_type * release() noexcept; void swap(unique_lock &) noexcept; };
unique_lock
public
construct/copy/destructunique_lock() noexcept;
explicit unique_lock(mutex_type & m);
unique_lock(mutex_type & m, adopt_lock_t) noexcept;
unique_lock(mutex_type & m, defer_lock_t) noexcept;
unique_lock(mutex_type & m, try_to_lock_t);
template<typename Time> unique_lock(unspecified m, Time const & t);
unique_lock(unique_lock && that) noexcept;
explicit unique_lock(upgrade_lock< mutex_type > && that);
unique_lock(upgrade_lock< mutex_type > && ul, try_to_lock_t);
unique_lock(shared_lock< mutex_type > && sl, try_to_lock_t);
template<typename Time> unique_lock(shared_lock< mutex_type > && sl, Time const & t, unspecified = 0);
unique_lock & operator=(unique_lock && that) noexcept;
unique_lock & operator=(upgrade_lock< mutex_type > && that);
~unique_lock();
unique_lock
public member functionsvoid lock();
bool try_lock();
template<typename Time> unspecified timed_lock(Time const & time);
template<typename Duration> unspecified try_lock_for(Duration const & rel_time);
template<typename TimePoint> unspecified try_lock_until(TimePoint const & abs_time);
void unlock();
explicit operator bool() const;
bool operator!() const noexcept;
bool owns_lock() const noexcept;
mutex_type * mutex() const noexcept;
mutex_type * release() noexcept;
void swap(unique_lock & that) noexcept;