19 #if FOLLY_HAS_COROUTINES 31 state_.load(std::memory_order_relaxed) ==
nullptr);
39 if (waitersHead ==
nullptr) {
40 void* currentState =
state_.load(std::memory_order_relaxed);
41 if (currentState ==
nullptr) {
45 const bool releasedLock =
state_.compare_exchange_strong(
48 std::memory_order_release,
49 std::memory_order_relaxed);
57 currentState =
state_.exchange(
nullptr, std::memory_order_acquire);
60 assert(currentState !=
nullptr);
64 auto*
temp = waiter->next_;
65 waiter->next_ = waitersHead;
68 }
while (waiter !=
nullptr);
71 assert(waitersHead !=
nullptr);
79 void* oldValue =
state_.load(std::memory_order_relaxed);
84 void* newValue =
nullptr;
85 if (
state_.compare_exchange_weak(
88 std::memory_order_acquire,
89 std::memory_order_relaxed)) {
96 void* newValue = awaiter;
98 if (
state_.compare_exchange_weak(
101 std::memory_order_release,
102 std::memory_order_relaxed)) {
std::atomic< void * > state_
requires E e noexcept(noexcept(s.error(std::move(e))))
void * unlockedState() noexcept
friend class LockOperation
bool lockAsyncImpl(LockOperation *awaiter)
std::experimental::coroutine_handle awaitingCoroutine_