File tree Expand file tree Collapse file tree 1 file changed +2
-12
lines changed Expand file tree Collapse file tree 1 file changed +2
-12
lines changed Original file line number Diff line number Diff line change @@ -44,10 +44,7 @@ namespace concurrencpp::details {
44
44
const std::function<void (std::string_view thread_name)> m_thread_terminated_callback;
45
45
46
46
void balance_work ();
47
-
48
- bool wait_for_task (std::unique_lock<std::mutex>& lock);
49
47
bool drain_queue_impl ();
50
- bool drain_queue ();
51
48
52
49
void work_loop ();
53
50
@@ -278,14 +275,12 @@ void thread_pool_worker::balance_work() {
278
275
}
279
276
280
277
bool thread_pool_worker::drain_queue_impl () {
281
- auto aborted = false ;
282
-
283
278
while (!m_private_queue.empty ()) {
284
279
balance_work ();
285
280
286
281
if (m_atomic_abort.load (std::memory_order_relaxed)) {
287
- aborted = true ;
288
- break ;
282
+ mark_worker_stale () ;
283
+ return false ;
289
284
}
290
285
291
286
assert (!m_private_queue.empty ());
@@ -294,11 +289,6 @@ bool thread_pool_worker::drain_queue_impl() {
294
289
task ();
295
290
}
296
291
297
- if (aborted) {
298
- mark_worker_stale ();
299
- return false ;
300
- }
301
-
302
292
return true ;
303
293
}
304
294
You can’t perform that action at this time.
0 commit comments