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

Method removeNextPending

lib/cpp/src/thrift/concurrency/ThreadManager.cpp:509–525  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

507}
508
509std::shared_ptr<Runnable> ThreadManager::Impl::removeNextPending() {
510 Guard g(mutex_);
511 if (state_ != ThreadManager::STARTED) {
512 throw IllegalStateException(
513 "ThreadManager::Impl::removeNextPending "
514 "ThreadManager not started");
515 }
516
517 if (tasks_.empty()) {
518 return std::shared_ptr<Runnable>();
519 }
520
521 shared_ptr<ThreadManager::Task> task = tasks_.front();
522 tasks_.pop_front();
523
524 return task->getRunnable();
525}
526
527void ThreadManager::Impl::removeExpired(bool justOne) {
528 // this is always called under a lock

Callers 2

drainPendingTaskMethod · 0.80

Calls 3

emptyMethod · 0.80
getRunnableMethod · 0.45

Tested by 1