Skip to content

Commit 86c66d0

Browse files
authored
fix thread execute at idle (#536)
### What problem were solved in this pull request? Issue Number: close #519 Problem: ### What is changed and how it works? ### Other information
1 parent a6b9e73 commit 86c66d0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/common/thread/thread_pool_executor.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,8 @@ void ThreadPoolExecutor::thread_func()
156156
if (keep_alive_time_ms_.count() > 0) {
157157
idle_deadline = Clock::now() + keep_alive_time_ms_;
158158
}
159+
} else {
160+
this_thread::sleep_for(10ms);
159161
}
160162
if (state_ != State::RUNNING && work_queue_->size() == 0) {
161163
break;

0 commit comments

Comments
 (0)