Template Class mutex

Class Documentation

template<typename MutexType, typename MutexRobustness>
class mutex

A class template that provides a pthread mutex with the priority inheritance protocol.

Template Parameters:
  • MutexType – The type of the mutex. It can be one of the following: PTHREAD_MUTEX_NORMAL, PTHREAD_MUTEX_RECURSIVE, PTHREAD_MUTEX_ERRORCHECK, PTHREAD_MUTEX_DEFAULT

  • MutexRobustness – The robustness of the mutex. It can be one of the following: PTHREAD_MUTEX_STALLED, PTHREAD_MUTEX_ROBUST

Public Types

using native_handle_type = pthread_mutex_t*
using type = MutexType
using robustness = MutexRobustness

Public Functions

inline mutex()
inline ~mutex()
mutex(const mutex&) = delete
mutex &operator=(const mutex&) = delete
inline native_handle_type native_handle() noexcept
inline void lock()
inline void unlock() noexcept
inline bool try_lock()