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

Method start

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

Source from the content-addressed store, hash-verified

173}
174
175void TimerManager::start() {
176 bool doStart = false;
177 {
178 Synchronized s(monitor_);
179 if (!threadFactory_) {
180 throw InvalidArgumentException();
181 }
182 if (state_ == TimerManager::UNINITIALIZED) {
183 state_ = TimerManager::STARTING;
184 doStart = true;
185 }
186 }
187
188 if (doStart) {
189 dispatcherThread_ = threadFactory_->newThread(dispatcher_);
190 dispatcherThread_->start();
191 }
192
193 {
194 Synchronized s(monitor_);
195 while (state_ == TimerManager::STARTING) {
196 monitor_.wait();
197 }
198 assert(state_ != TimerManager::STARTING);
199 }
200}
201
202void TimerManager::stop() {
203 bool doStop = false;

Callers

nothing calls this directly

Calls 3

newThreadMethod · 0.45
waitMethod · 0.45

Tested by

no test coverage detected