...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::interprocess::null_mutex
// In header: <boost/interprocess/sync/null_mutex.hpp> class null_mutex { public: // construct/copy/destruct null_mutex() noexcept; ~null_mutex(); // public member functions void lock(); bool try_lock(); template<typename TimePoint> bool timed_lock(const TimePoint &); template<typename TimePoint> bool try_lock_until(const TimePoint &); template<typename Duration> bool try_lock_for(const Duration &); void unlock(); void lock_sharable(); void lock_shared(); bool try_lock_sharable(); bool try_lock_shared(); template<typename TimePoint> bool timed_lock_sharable(const TimePoint &); void unlock_sharable(); void unlock_shared(); void lock_upgradable(); bool try_lock_upgradable(); template<typename TimePoint> bool timed_lock_upgradable(const TimePoint &); void unlock_upgradable(); void unlock_and_lock_upgradable(); void unlock_and_lock_sharable(); void unlock_upgradable_and_lock_sharable(); void unlock_upgradable_and_lock(); bool try_unlock_upgradable_and_lock(); template<typename TimePoint> bool timed_unlock_upgradable_and_lock(const TimePoint &); bool try_unlock_sharable_and_lock(); bool try_unlock_sharable_and_lock_upgradable(); };
Implements a mutex that simulates a mutex without doing any operation and simulates a successful operation.
null_mutex
public member functionsvoid lock();Simulates a mutex lock() operation. Empty function.
bool try_lock();
Simulates a mutex try_lock() operation. Equivalent to "return true;"
template<typename TimePoint> bool timed_lock(const TimePoint &);
Simulates a mutex timed_lock() operation. Equivalent to "return true;"
template<typename TimePoint> bool try_lock_until(const TimePoint &);
Same as timed_lock
, but this function is modeled after the standard library interface.
template<typename Duration> bool try_lock_for(const Duration &);
Same as timed_lock
, but this function is modeled after the standard library interface.
void unlock();
Simulates a mutex unlock() operation. Empty function.
void lock_sharable();
Simulates a mutex lock_sharable() operation. Empty function.
void lock_shared();
Same as lock_sharable
but with a std-compatible interface
bool try_lock_sharable();
Simulates a mutex try_lock_sharable() operation. Equivalent to "return true;"
bool try_lock_shared();
Same as try_lock_sharable
but with a std-compatible interface
template<typename TimePoint> bool timed_lock_sharable(const TimePoint &);
Simulates a mutex timed_lock_sharable() operation. Equivalent to "return true;"
void unlock_sharable();
Simulates a mutex unlock_sharable() operation. Empty function.
void unlock_shared();
Same as unlock_sharable
but with a std-compatible interface
void lock_upgradable();
Simulates a mutex lock_upgradable() operation. Empty function.
bool try_lock_upgradable();
Simulates a mutex try_lock_upgradable() operation. Equivalent to "return true;"
template<typename TimePoint> bool timed_lock_upgradable(const TimePoint &);
Simulates a mutex timed_lock_upgradable() operation. Equivalent to "return true;"
void unlock_upgradable();
Simulates a mutex unlock_upgradable() operation. Empty function.
void unlock_and_lock_upgradable();
Simulates unlock_and_lock_upgradable(). Empty function.
void unlock_and_lock_sharable();
Simulates unlock_and_lock_sharable(). Empty function.
void unlock_upgradable_and_lock_sharable();
Simulates unlock_upgradable_and_lock_sharable(). Empty function.
void unlock_upgradable_and_lock();
Simulates unlock_upgradable_and_lock(). Empty function.
bool try_unlock_upgradable_and_lock();
Simulates try_unlock_upgradable_and_lock(). Equivalent to "return true;"
template<typename TimePoint> bool timed_unlock_upgradable_and_lock(const TimePoint &);
Simulates timed_unlock_upgradable_and_lock(). Equivalent to "return true;"
bool try_unlock_sharable_and_lock();
Simulates try_unlock_sharable_and_lock(). Equivalent to "return true;"
bool try_unlock_sharable_and_lock_upgradable();
Simulates try_unlock_sharable_and_lock_upgradable(). Equivalent to "return true;"