![]() |
boost::sync::upgrade_lock — An upgradeable lock scope guard.
// In header: <boost/sync/locks/upgrade_lock.hpp> template<typename Mutex> class upgrade_lock { public: // types typedef Mutex mutex_type; // construct/copy/destruct upgrade_lock() noexcept; explicit upgrade_lock(mutex_type &); upgrade_lock(mutex_type &, adopt_lock_t) noexcept; upgrade_lock(mutex_type &, defer_lock_t) noexcept; upgrade_lock(mutex_type &, try_to_lock_t); template<typename Time> upgrade_lock(unspecified, Time const &); upgrade_lock(upgrade_lock &&) noexcept; explicit upgrade_lock(unique_lock< mutex_type > &&); upgrade_lock(shared_lock< mutex_type > &&, try_to_lock_t); template<typename Time> upgrade_lock(shared_lock< mutex_type > &&, Time const &, unspecified = 0); upgrade_lock & operator=(upgrade_lock &&) noexcept; upgrade_lock & operator=(unique_lock< mutex_type > &&); ~upgrade_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(upgrade_lock &) noexcept; };
A unique lock scope guard.
upgrade_lock
public
construct/copy/destructupgrade_lock() noexcept;
explicit upgrade_lock(mutex_type & m);
upgrade_lock(mutex_type & m, adopt_lock_t) noexcept;
upgrade_lock(mutex_type & m, defer_lock_t) noexcept;
upgrade_lock(mutex_type & m, try_to_lock_t);
template<typename Time> upgrade_lock(unspecified m, Time const & t);
upgrade_lock(upgrade_lock && that) noexcept;
explicit upgrade_lock(unique_lock< mutex_type > && that);
upgrade_lock(shared_lock< mutex_type > && sl, try_to_lock_t);
template<typename Time> upgrade_lock(shared_lock< mutex_type > && sl, Time const & t, unspecified = 0);
upgrade_lock & operator=(upgrade_lock && that) noexcept;
upgrade_lock & operator=(unique_lock< mutex_type > && that);
~upgrade_lock();
upgrade_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(upgrade_lock & that) noexcept;