MCPcopy Create free account
hub / github.com/boostorg/asio / run

Method run

example/cpp14/executors/priority_scheduler.cpp:94–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92 }
93
94 void run()
95 {
96 std::unique_lock<std::mutex> lock(mutex_);
97 for (;;)
98 {
99 condition_.wait(lock, [&]{ return stopped_ || !queue_.empty(); });
100 if (stopped_)
101 return;
102 auto p(queue_.top());
103 queue_.pop();
104 lock.unlock();
105 p->execute_(p);
106 lock.lock();
107 }
108 }
109
110 void stop()
111 {

Callers 15

mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45

Calls 6

topMethod · 0.80
waitMethod · 0.45
emptyMethod · 0.45
popMethod · 0.45
unlockMethod · 0.45
lockMethod · 0.45

Tested by 15

test_callbackFunction · 0.36
test_deferredFunction · 0.36
test_futureFunction · 0.36
test_callbackFunction · 0.36
test_deferredFunction · 0.36
test_callbackFunction · 0.36
test_deferredFunction · 0.36
test_futureFunction · 0.36
test_callbackFunction · 0.36
test_deferredFunction · 0.36
test_futureFunction · 0.36
test_callbackFunction · 0.36