MCPcopy Create free account
hub / github.com/David-Haim/concurrencpp / await_suspend

Method await_suspend

source/threads/async_condition_variable.cpp:18–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16cv_awaiter::cv_awaiter(async_condition_variable& parent, scoped_async_lock& lock) noexcept : m_parent(parent), m_lock(lock) {}
17
18void cv_awaiter::await_suspend(details::coroutine_handle<void> caller_handle) {
19 m_caller_handle = caller_handle;
20
21 std::unique_lock<std::mutex> lock(m_parent.m_lock);
22 m_lock.unlock();
23
24 m_parent.m_awaiters.push_back(*this);
25}
26
27void cv_awaiter::resume() noexcept {
28 assert(static_cast<bool>(m_caller_handle));

Callers

nothing calls this directly

Calls 2

unlockMethod · 0.80
push_backMethod · 0.80

Tested by

no test coverage detected