MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / waitBlocking

Method waitBlocking

source/MRViewer/MRAsyncTimer.cpp:40–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40auto AsyncTimer::waitBlocking() -> Event
41{
42 std::unique_lock lock( mutex_ );
43 for (;;)
44 {
45 if ( terminating_ )
46 return Event::Terminate;
47 if ( time_ )
48 {
49 auto waitTime = *time_;
50 if ( std::cv_status::timeout == cvar_.wait_until( lock, waitTime ) )
51 {
52 if ( time_ && *time_ == waitTime ) //nothing has changed
53 {
54 time_.reset();
55 return Event::AlertTimeReached;
56 }
57 }
58 continue;
59 }
60 cvar_.wait( lock );
61 }
62}
63
64#ifndef __EMSCRIPTEN__
65AsyncRequest::AsyncRequest()

Callers 1

AsyncRequestMethod · 0.80

Calls 1

resetMethod · 0.45

Tested by

no test coverage detected