...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::log::sources::multi_thread_model — Multi-thread locking model with maximum locking capabilities.
// In header: <boost/log/sources/threading_models.hpp> template<typename MutexT> struct multi_thread_model { // construct/copy/destruct multi_thread_model() noexcept(boost::has_nothrow_constructor< MutexT >::value)); multi_thread_model(multi_thread_model const &) noexcept(boost::has_nothrow_constructor< MutexT >::value)); multi_thread_model(multi_thread_model &&) noexcept(boost::has_nothrow_constructor< MutexT >::value)); multi_thread_model & operator=(multi_thread_model const &) noexcept; multi_thread_model & operator=(multi_thread_model &&) noexcept; // public member functions void lock_shared() const; bool try_lock_shared() const; template<typename TimeT> bool timed_lock_shared(TimeT const &) const; void unlock_shared() const noexcept; void lock() const; bool try_lock() const; template<typename TimeT> bool timed_lock(TimeT const &) const; void unlock() const noexcept; void lock_upgrade() const; bool try_lock_upgrade() const; template<typename TimeT> bool timed_lock_upgrade(TimeT const &) const; void unlock_upgrade() const noexcept; void unlock_upgrade_and_lock() const; void unlock_and_lock_upgrade() const; void unlock_and_lock_shared() const; void unlock_upgrade_and_lock_shared() const; void swap(multi_thread_model &) noexcept; };
multi_thread_model
public
construct/copy/destructmulti_thread_model() noexcept(boost::has_nothrow_constructor< MutexT >::value));
multi_thread_model(multi_thread_model const &) noexcept(boost::has_nothrow_constructor< MutexT >::value));
multi_thread_model(multi_thread_model &&) noexcept(boost::has_nothrow_constructor< MutexT >::value));
multi_thread_model & operator=(multi_thread_model const &) noexcept;
multi_thread_model & operator=(multi_thread_model &&) noexcept;
multi_thread_model
public member functionsvoid lock_shared() const;
bool try_lock_shared() const;
template<typename TimeT> bool timed_lock_shared(TimeT const & t) const;
void unlock_shared() const noexcept;
void lock() const;
bool try_lock() const;
template<typename TimeT> bool timed_lock(TimeT const & t) const;
void unlock() const noexcept;
void lock_upgrade() const;
bool try_lock_upgrade() const;
template<typename TimeT> bool timed_lock_upgrade(TimeT const & t) const;
void unlock_upgrade() const noexcept;
void unlock_upgrade_and_lock() const;
void unlock_and_lock_upgrade() const;
void unlock_and_lock_shared() const;
void unlock_upgrade_and_lock_shared() const;
void swap(multi_thread_model &) noexcept;