proxygen
folly::detail::LockTraitsImpl< Mutex, MutexLevel::SHARED, false > Struct Template Reference

#include <LockTraits.h>

Inheritance diagram for folly::detail::LockTraitsImpl< Mutex, MutexLevel::SHARED, false >:
folly::detail::LockTraitsImpl< Mutex, MutexLevel::UNIQUE, false > folly::detail::LockTraitsImpl< Mutex, MutexLevel::SHARED, true > folly::detail::LockTraitsImpl< Mutex, MutexLevel::UPGRADE, false > folly::detail::LockTraitsImpl< Mutex, MutexLevel::UPGRADE, true > folly::detail::LockTraitsImpl< Mutex, MutexLevel::UPGRADE, true >

Static Public Member Functions

static void lock_shared (Mutex &mutex)
 
static void unlock_shared (Mutex &mutex)
 
static bool try_lock_shared (Mutex &mutex)
 
- Static Public Member Functions inherited from folly::detail::LockTraitsImpl< Mutex, MutexLevel::UNIQUE, false >
static void lock (Mutex &mutex)
 
static void unlock (Mutex &mutex)
 
static bool try_lock (Mutex &mutex)
 

Static Public Attributes

static constexpr bool is_timed {false}
 
static constexpr bool is_shared {true}
 
static constexpr bool is_upgrade {false}
 
- Static Public Attributes inherited from folly::detail::LockTraitsImpl< Mutex, MutexLevel::UNIQUE, false >
static constexpr bool is_timed {false}
 
static constexpr bool is_shared {false}
 
static constexpr bool is_upgrade {false}
 

Detailed Description

template<class Mutex>
struct folly::detail::LockTraitsImpl< Mutex, MutexLevel::SHARED, false >

Higher level mutexes have all the capabilities of the lower levels so inherit

Definition at line 147 of file LockTraits.h.

Member Function Documentation

template<class Mutex >
static void folly::detail::LockTraitsImpl< Mutex, MutexLevel::SHARED, false >::lock_shared ( Mutex mutex)
inlinestatic

Acquire the lock in shared (read) mode.

Definition at line 156 of file LockTraits.h.

156  {
157  mutex.lock_shared();
158  }
std::mutex mutex
template<class Mutex >
static bool folly::detail::LockTraitsImpl< Mutex, MutexLevel::SHARED, false >::try_lock_shared ( Mutex mutex)
inlinestatic

Try to acquire the mutex in shared mode

Definition at line 170 of file LockTraits.h.

170  {
171  return mutex.try_lock_shared();
172  }
std::mutex mutex
template<class Mutex >
static void folly::detail::LockTraitsImpl< Mutex, MutexLevel::SHARED, false >::unlock_shared ( Mutex mutex)
inlinestatic

Release a lock held in shared mode.

Definition at line 163 of file LockTraits.h.

163  {
164  mutex.unlock_shared();
165  }
std::mutex mutex

Member Data Documentation

template<class Mutex >
constexpr bool folly::detail::LockTraitsImpl< Mutex, MutexLevel::SHARED, false >::is_shared {true}
static

Definition at line 150 of file LockTraits.h.

template<class Mutex >
constexpr bool folly::detail::LockTraitsImpl< Mutex, MutexLevel::SHARED, false >::is_timed {false}
static

Definition at line 149 of file LockTraits.h.

template<class Mutex >
constexpr bool folly::detail::LockTraitsImpl< Mutex, MutexLevel::SHARED, false >::is_upgrade {false}
static

Definition at line 151 of file LockTraits.h.


The documentation for this struct was generated from the following file: