proxygen
DistributedMutex-inl.h File Reference
#include <folly/synchronization/DistributedMutex.h>
#include <folly/CachelinePadded.h>
#include <folly/Likely.h>
#include <folly/Portability.h>
#include <folly/ScopeGuard.h>
#include <folly/Utility.h>
#include <folly/detail/Futex.h>
#include <folly/lang/Align.h>
#include <folly/portability/Asm.h>
#include <folly/synchronization/AtomicNotification.h>
#include <folly/synchronization/AtomicUtil.h>
#include <folly/synchronization/WaitOptions.h>
#include <folly/synchronization/detail/Sleeper.h>
#include <folly/synchronization/detail/Spin.h>
#include <glog/logging.h>
#include <atomic>
#include <cstdint>
#include <limits>
#include <stdexcept>
#include <thread>

Go to the source code of this file.

Classes

class  folly::detail::distributed_mutex::WakerMetadata
 
class  folly::detail::distributed_mutex::Waiter< Atomic >
 
class  folly::detail::distributed_mutex::DistributedMutex< Atomic, TimePublishing >::DistributedMutexStateProxy< Atomic, TimePublishing >
 

Namespaces

 folly
 —— Concurrent Priority Queue Implementation ——
 
 folly::detail
 
 folly::detail::distributed_mutex
 

Functions

std::chrono::nanoseconds folly::detail::distributed_mutex::time ()
 
template<typename Type >
Type * folly::detail::distributed_mutex::extractAddress (std::uintptr_t from)
 
std::uint64_t folly::detail::distributed_mutex::strip (std::chrono::nanoseconds t)
 
std::uint64_t folly::detail::distributed_mutex::recover (std::uint64_t from)
 
template<typename Waiter >
bool folly::detail::distributed_mutex::spin (Waiter &waiter)
 
template<typename Waiter >
void folly::detail::distributed_mutex::doFutexWake (Waiter *waiter)
 
template<typename Waiter >
bool folly::detail::distributed_mutex::doFutexWait (Waiter *waiter, Waiter *&next)
 
template<typename Waiter >
bool folly::detail::distributed_mutex::wait (Waiter *waiter, bool shouldSleep, Waiter *&next)
 
void folly::detail::distributed_mutex::recordTimedWaiterAndClearTimedBit (bool &timedWaiter, std::uintptr_t &previous)
 
bool folly::detail::distributed_mutex::preempted (std::uint64_t value)
 
bool folly::detail::distributed_mutex::isSleeper (std::uintptr_t value)
 
template<typename Waiter >
std::uintptr_t folly::detail::distributed_mutex::tryWake (bool publishing, Waiter *waiter, std::uintptr_t value, WakerMetadata metadata, Waiter *&sleepers)
 
template<typename Waiter >
bool folly::detail::distributed_mutex::wake (bool publishing, Waiter &waiter, WakerMetadata metadata, Waiter *&sleepers)
 
template<typename Atomic >
void folly::detail::distributed_mutex::wakeTimedWaiters (Atomic *state, bool timedWaiters)
 
template<typename Atomic , typename Proxy , typename Sleepers >
bool folly::detail::distributed_mutex::tryUnlockClean (Atomic &state, Proxy &proxy, Sleepers sleepers)
 
template<typename Atomic , typename Deadline , typename MakeProxy >
auto folly::detail::distributed_mutex::timedLock (Atomic &state, Deadline deadline, MakeProxy proxy)
 

Variables

constexpr auto folly::detail::distributed_mutex::kUnlocked = std::uintptr_t{0b0}
 
constexpr auto folly::detail::distributed_mutex::kLocked = std::uintptr_t{0b1}
 
constexpr auto folly::detail::distributed_mutex::kTimedWaiter = std::uintptr_t{0b10}
 
constexpr auto folly::detail::distributed_mutex::kUninitialized = std::uint32_t{0b0}
 
constexpr auto folly::detail::distributed_mutex::kWaiting = std::uint32_t{0b1}
 
constexpr auto folly::detail::distributed_mutex::kWake = std::uint32_t{0b10}
 
constexpr auto folly::detail::distributed_mutex::kSkipped = std::uint32_t{0b11}
 
constexpr auto folly::detail::distributed_mutex::kAboutToWait = std::uint32_t{0b100}
 
constexpr auto folly::detail::distributed_mutex::kSleeping = std::uint32_t{0b101}
 
constexpr auto folly::detail::distributed_mutex::kScheduledAwaySpinThreshold = std::chrono::nanoseconds{200}
 
constexpr auto folly::detail::distributed_mutex::kMaxSpins = 4000