proxygen
folly::LockPolicyFromUpgradeToExclusive Struct Reference

#include <LockTraits.h>

Inheritance diagram for folly::LockPolicyFromUpgradeToExclusive:
folly::LockPolicyExclusive folly::detail::UnlockPolicyExclusive< LockTraits >

Static Public Member Functions

template<class Mutex >
static std::true_type lock (Mutex &mutex)
 
template<class Mutex , class Rep , class Period >
static bool try_lock_for (Mutex &mutex, const std::chrono::duration< Rep, Period > &timeout)
 
- Static Public Member Functions inherited from folly::LockPolicyExclusive
template<class Mutex >
static std::true_type lock (Mutex &mutex)
 
template<class Mutex , class Rep , class Period >
static bool try_lock_for (Mutex &mutex, const std::chrono::duration< Rep, Period > &timeout)
 
- Static Public Member Functions inherited from folly::detail::UnlockPolicyExclusive< LockTraits >
template<typename Mutex >
static void unlock (Mutex &mutex)
 

Additional Inherited Members

- Public Types inherited from folly::LockPolicyExclusive
using UnlockPolicy = detail::UnlockPolicyExclusive< LockTraits >
 

Detailed Description

A lock policy with the following mapping

lock() -> unlock_upgrade_and_lock() unlock() -> unlock() try_lock_for -> try_unlock_upgrade_and_lock_for()

Definition at line 579 of file LockTraits.h.

Member Function Documentation

template<class Mutex >
static std::true_type folly::LockPolicyFromUpgradeToExclusive::lock ( Mutex mutex)
inlinestatic

Definition at line 581 of file LockTraits.h.

Referenced by TEST().

581  {
582  LockTraits<Mutex>::unlock_upgrade_and_lock(mutex);
583  return std::true_type{};
584  }
bool_constant< true > true_type
Definition: gtest-port.h:2210
std::mutex mutex
template<class Mutex , class Rep , class Period >
static bool folly::LockPolicyFromUpgradeToExclusive::try_lock_for ( Mutex mutex,
const std::chrono::duration< Rep, Period > &  timeout 
)
inlinestatic

Definition at line 586 of file LockTraits.h.

Referenced by TEST().

588  {
589  return LockTraits<Mutex>::try_unlock_upgrade_and_lock_for(mutex, timeout);
590  }
std::mutex mutex

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