MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / stop

Method stop

Source/Common/Async.cpp:42–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40}
41
42void Async::stop() {
43 std::lock_guard<std::mutex> guard(_stopMutex);
44 if (_stopped.exchange(true, std::memory_order_acq_rel)) {
45 return;
46 }
47 if (_thread.isRunning()) {
48 if (isPoolWorker()) {
49 _pool->notifyAllWorkers();
50 } else {
51 _workerSemaphore.post();
52 }
53 _thread.shutdown();
54 }
55}
56
57void Async::run(const std::function<Own<Values>()>& worker, const std::function<void(Own<Values>)>& finisher) {
58 if (_stopped.load(std::memory_order_acquire)) {

Callers

nothing calls this directly

Calls 5

exchangeMethod · 0.80
notifyAllWorkersMethod · 0.80
postMethod · 0.65
shutdownMethod · 0.65
isRunningMethod · 0.45

Tested by

no test coverage detected