proxygen
folly::detail::LockTraitsImpl< Mutex, MutexLevel::UPGRADE, true > Struct Template Reference

#include <LockTraits.h>

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

Static Public Member Functions

template<class Rep , class Period >
static bool try_lock_upgrade_for (Mutex &mutex, const std::chrono::duration< Rep, Period > &timeout)
 
template<class Rep , class Period >
static bool try_unlock_upgrade_and_lock_for (Mutex &mutex, const std::chrono::duration< Rep, Period > &timeout)
 
- Static Public Member Functions inherited from folly::detail::LockTraitsImpl< Mutex, MutexLevel::UPGRADE, false >
static void lock_upgrade (Mutex &mutex)
 
static void unlock_upgrade (Mutex &mutex)
 
static bool try_lock_upgrade (Mutex &mutex)
 
static void unlock_upgrade_and_lock (Mutex &mutex)
 
static void unlock_and_lock_upgrade (Mutex &mutex)
 
static void unlock_and_lock_shared (Mutex &mutex)
 
static void unlock_upgrade_and_lock_shared (Mutex &mutex)
 
- Static Public Member Functions inherited from folly::detail::LockTraitsImpl< Mutex, MutexLevel::SHARED, false >
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 Member Functions inherited from folly::detail::LockTraitsImpl< Mutex, MutexLevel::SHARED, true >
template<class Rep , class Period >
static bool try_lock_for (Mutex &mutex, const std::chrono::duration< Rep, Period > &timeout)
 
template<class Rep , class Period >
static bool try_lock_shared_for (Mutex &mutex, const std::chrono::duration< Rep, Period > &timeout)
 
- Static Public Member Functions inherited from folly::detail::LockTraitsImpl< Mutex, MutexLevel::UNIQUE, true >
template<class Rep , class Period >
static bool try_lock_for (Mutex &mutex, const std::chrono::duration< Rep, Period > &timeout)
 

Static Public Attributes

static constexpr bool is_timed {true}
 
static constexpr bool is_shared {true}
 
static constexpr bool is_upgrade {true}
 
- Static Public Attributes inherited from folly::detail::LockTraitsImpl< Mutex, MutexLevel::UPGRADE, false >
static constexpr bool is_timed {false}
 
static constexpr bool is_shared {true}
 
static constexpr bool is_upgrade {true}
 
- Static Public Attributes inherited from folly::detail::LockTraitsImpl< Mutex, MutexLevel::SHARED, false >
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}
 
- Static Public Attributes inherited from folly::detail::LockTraitsImpl< Mutex, MutexLevel::SHARED, true >
static constexpr bool is_timed {true}
 
static constexpr bool is_shared {true}
 
static constexpr bool is_upgrade {false}
 
- Static Public Attributes inherited from folly::detail::LockTraitsImpl< Mutex, MutexLevel::UNIQUE, true >
static constexpr bool is_timed {true}
 
static constexpr bool is_shared {false}
 
static constexpr bool is_upgrade {false}
 

Detailed Description

template<class Mutex>
struct folly::detail::LockTraitsImpl< Mutex, MutexLevel::UPGRADE, true >

Definition at line 319 of file LockTraits.h.

Member Function Documentation

template<class Mutex >
template<class Rep , class Period >
static bool folly::detail::LockTraitsImpl< Mutex, MutexLevel::UPGRADE, true >::try_lock_upgrade_for ( Mutex mutex,
const std::chrono::duration< Rep, Period > &  timeout 
)
inlinestatic

Acquire the lock in upgrade mode with a timeout

Returns true or false indicating whether the lock was acquired or not

Definition at line 332 of file LockTraits.h.

334  {
335  return mutex.try_lock_upgrade_for(timeout);
336  }
std::mutex mutex
template<class Mutex >
template<class Rep , class Period >
static bool folly::detail::LockTraitsImpl< Mutex, MutexLevel::UPGRADE, true >::try_unlock_upgrade_and_lock_for ( Mutex mutex,
const std::chrono::duration< Rep, Period > &  timeout 
)
inlinestatic

Try to upgrade from an upgradable state to an exclusive state.

Returns true or false indicating whether the lock was acquired or not

Definition at line 344 of file LockTraits.h.

346  {
347  return mutex.try_unlock_upgrade_and_lock_for(timeout);
348  }
std::mutex mutex

Member Data Documentation

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

Definition at line 323 of file LockTraits.h.

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

Definition at line 322 of file LockTraits.h.

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

Definition at line 324 of file LockTraits.h.


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