C++ Mutex Types


Example

C++1x offers a selection of mutex classes:

  • std::mutex - offers simple locking functionality.
  • std::timed_mutex - offers try_to_lock functionality
  • std::recursive_mutex - allows recursive locking by the same thread.
  • std::shared_mutex, std::shared_timed_mutex - offers shared and unique lock functionality.