We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 12c2a72 commit 36fbcb5Copy full SHA for 36fbcb5
1 file changed
async_simple/coro/ConditionVariable.h
@@ -105,13 +105,13 @@ inline void ConditionVariable<Lock>::notifyAll() noexcept {
105
template <class Lock>
106
inline void ConditionVariable<Lock>::notifyOne() noexcept {
107
auto awaitings = _awaiters.load(std::memory_order_acquire);
108
- if (!awaitings) {
109
- return;
110
- }
111
- while (!_awaiters.compare_exchange_weak(awaitings, awaitings->_next,
+ while (awaitings && !_awaiters.compare_exchange_weak(awaitings, awaitings->_next,
112
std::memory_order_acq_rel,
113
std::memory_order_acquire))
114
;
+ if (!awaitings) {
+ return;
+ }
115
awaitings->_next = nullptr;
116
resumeWaiters(awaitings);
117
}
0 commit comments