MCPcopy Create free account
hub / github.com/apache/thrift / stop

Method stop

lib/cpp/src/thrift/concurrency/TimerManager.cpp:202–225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

200}
201
202void TimerManager::stop() {
203 bool doStop = false;
204 {
205 Synchronized s(monitor_);
206 if (state_ == TimerManager::UNINITIALIZED) {
207 state_ = TimerManager::STOPPED;
208 } else if (state_ != STOPPING && state_ != STOPPED) {
209 doStop = true;
210 state_ = STOPPING;
211 monitor_.notifyAll();
212 }
213 while (state_ != STOPPED) {
214 monitor_.wait();
215 }
216 }
217
218 if (doStop) {
219 // Clean up any outstanding tasks
220 taskMap_.clear();
221
222 // Remove dispatcher's reference to us.
223 dispatcher_->manager_ = nullptr;
224 }
225}
226
227shared_ptr<const ThreadFactory> TimerManager::threadFactory() const {
228 Synchronized s(monitor_);

Callers

nothing calls this directly

Calls 3

clearMethod · 0.65
notifyAllMethod · 0.45
waitMethod · 0.45

Tested by

no test coverage detected