MCPcopy Create free account
hub / github.com/GameTechDev/PresentMon / Lock

Method Lock

IntelPresentMon/CommonUtilities/pipe/CoroMutex.cpp:6–18  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4namespace pmon::util::pipe
5{
6 as::awaitable<void> CoroMutex::Lock()
7 {
8 if (counter_++ == 0) {
9 co_return;
10 }
11
12 auto ec = boost::system::error_code{};
13 Timer timer{ ctx_ };
14 timer.expires_after(Timer::duration::max());
15 waiters_.push_back(&timer);
16 co_await timer.async_wait(as::redirect_error(as::use_awaitable, ec));
17 holdoff_ = false;
18 }
19 bool CoroMutex::TryLock()
20 {
21 if (counter_ == 0) {

Callers 1

CoroLockFunction · 0.45

Calls 1

push_backMethod · 0.80

Tested by

no test coverage detected