| 368 | } |
| 369 | |
| 370 | void ThreadManager::Impl::start() { |
| 371 | Guard g(mutex_); |
| 372 | if (state_ == ThreadManager::STOPPED) { |
| 373 | return; |
| 374 | } |
| 375 | |
| 376 | if (state_ == ThreadManager::UNINITIALIZED) { |
| 377 | if (!threadFactory_) { |
| 378 | throw InvalidArgumentException(); |
| 379 | } |
| 380 | state_ = ThreadManager::STARTED; |
| 381 | monitor_.notifyAll(); |
| 382 | } |
| 383 | |
| 384 | while (state_ == STARTING) { |
| 385 | monitor_.wait(); |
| 386 | } |
| 387 | } |
| 388 | |
| 389 | void ThreadManager::Impl::stop() { |
| 390 | Guard g(mutex_); |
no test coverage detected