MCPcopy Create free account
hub / github.com/apple/foundationdb / stop

Method stop

flow/IThreadPool.cpp:87–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85 ThreadPool(int stackSize, int pri) : dontstop(ios), mode(Run), stackSize(stackSize), pri(pri) {}
86 ~ThreadPool() override {}
87 Future<Void> stop(Error const& e = success()) override {
88 if (mode == Shutdown)
89 return Void();
90 ReferenceCounted<ThreadPool>::addref();
91 ios.stop(); // doesn't work?
92 mode = Shutdown;
93 for (int i = 0; i < threads.size(); i++) {
94 waitThread(threads[i]->handle);
95 delete threads[i];
96 }
97 ReferenceCounted<ThreadPool>::delref();
98 return Void();
99 }
100
101 Future<Void> getError() const override { return Never(); } // FIXME
102 void addref() override { ReferenceCounted<ThreadPool>::addref(); }

Callers

nothing calls this directly

Calls 5

waitThreadFunction · 0.85
VoidClass · 0.70
addrefFunction · 0.50
delrefFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected