Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

PrevUpHomeNext

Class null_mutex

boost::interprocess::null_mutex

Synopsis

// In header: <boost/interprocess/sync/null_mutex.hpp>


class null_mutex {
public:

  // public member functions
  null_mutex() noexcept;
  ~null_mutex();
  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();
};

Description

Implements a mutex that simulates a mutex without doing any operation and simulates a successful operation.

null_mutex public member functions

  1. null_mutex() noexcept;

    Constructor. Empty.

  2. ~null_mutex();

    Destructor. Empty.

  3. void lock();
    Simulates a mutex lock() operation. Empty function.
  4. bool try_lock();

    Simulates a mutex try_lock() operation. Equivalent to "return true;"

  5. template<typename TimePoint> bool timed_lock(const TimePoint &);

    Simulates a mutex timed_lock() operation. Equivalent to "return true;"

  6. template<typename TimePoint> bool try_lock_until(const TimePoint &);

    Same as timed_lock, but this function is modeled after the standard library interface.

  7. template<typename Duration> bool try_lock_for(const Duration &);

    Same as timed_lock, but this function is modeled after the standard library interface.

  8. void unlock();

    Simulates a mutex unlock() operation. Empty function.

  9. void lock_sharable();

    Simulates a mutex lock_sharable() operation. Empty function.

  10. void lock_shared();

    Same as lock_sharable but with a std-compatible interface

  11. bool try_lock_sharable();

    Simulates a mutex try_lock_sharable() operation. Equivalent to "return true;"

  12. bool try_lock_shared();

    Same as try_lock_sharable but with a std-compatible interface

  13. template<typename TimePoint> bool timed_lock_sharable(const TimePoint &);

    Simulates a mutex timed_lock_sharable() operation. Equivalent to "return true;"

  14. void unlock_sharable();

    Simulates a mutex unlock_sharable() operation. Empty function.

  15. void unlock_shared();

    Same as unlock_sharable but with a std-compatible interface

  16. void lock_upgradable();

    Simulates a mutex lock_upgradable() operation. Empty function.

  17. bool try_lock_upgradable();

    Simulates a mutex try_lock_upgradable() operation. Equivalent to "return true;"

  18. template<typename TimePoint> bool timed_lock_upgradable(const TimePoint &);

    Simulates a mutex timed_lock_upgradable() operation. Equivalent to "return true;"

  19. void unlock_upgradable();

    Simulates a mutex unlock_upgradable() operation. Empty function.

  20. void unlock_and_lock_upgradable();

    Simulates unlock_and_lock_upgradable(). Empty function.

  21. void unlock_and_lock_sharable();

    Simulates unlock_and_lock_sharable(). Empty function.

  22. void unlock_upgradable_and_lock_sharable();

    Simulates unlock_upgradable_and_lock_sharable(). Empty function.

  23. void unlock_upgradable_and_lock();

    Simulates unlock_upgradable_and_lock(). Empty function.

  24. bool try_unlock_upgradable_and_lock();

    Simulates try_unlock_upgradable_and_lock(). Equivalent to "return true;"

  25. template<typename TimePoint> 
      bool timed_unlock_upgradable_and_lock(const TimePoint &);

    Simulates timed_unlock_upgradable_and_lock(). Equivalent to "return true;"

  26. bool try_unlock_sharable_and_lock();

    Simulates try_unlock_sharable_and_lock(). Equivalent to "return true;"

  27. bool try_unlock_sharable_and_lock_upgradable();

    Simulates try_unlock_sharable_and_lock_upgradable(). Equivalent to "return true;"


PrevUpHomeNext