MCPcopy Create free account
hub / github.com/CesiumGS/cesium-native / dispatchInternal

Method dispatchInternal

CesiumAsync/src/QueuedScheduler.cpp:92–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90}
91
92bool QueuedScheduler::dispatchInternal(bool blockIfNoTasks) {
93 async::task_run_handle t;
94
95 {
96 std::unique_lock<std::mutex> guard(this->_pImpl->mutex);
97 t = this->_pImpl->queue.pop();
98 if (blockIfNoTasks && !t) {
99 this->_pImpl->conditionVariable.wait(guard);
100 }
101 }
102
103 if (t) {
104 auto scope = this->immediate.scope();
105 t.run();
106 return true;
107 } else {
108 return false;
109 }
110}
111
112void QueuedScheduler::unblock() {
113 std::unique_lock<std::mutex> guard(this->_pImpl->mutex);

Callers 2

Calls 3

popMethod · 0.80
scopeMethod · 0.80
waitMethod · 0.45

Tested by

no test coverage detected