diff --git a/src/UtilsCtrl/ThreadPool/Thread/UThreadPrimary.h b/src/UtilsCtrl/ThreadPool/Thread/UThreadPrimary.h index abe5d995..9da7807c 100644 --- a/src/UtilsCtrl/ThreadPool/Thread/UThreadPrimary.h +++ b/src/UtilsCtrl/ThreadPool/Thread/UThreadPrimary.h @@ -116,7 +116,7 @@ class UThreadPrimary : public UThreadBase { CVoid fatWait() { ++cur_empty_epoch_; CGRAPH_YIELD(); - if (cur_empty_epoch_ >= config_->primary_thread_busy_epoch_) { + if (cur_empty_epoch_ >= config_->primary_thread_busy_epoch_ && wsq_.isEmpty()) { CGRAPH_UNIQUE_LOCK lk(mutex_); cv_.wait_for(lk, std::chrono::milliseconds(config_->primary_thread_empty_interval_), [this] { return 0 == cur_empty_epoch_ || !wsq_.isEmpty() || !done_; });