File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -742,17 +742,14 @@ void thread_pool_generic::submit_task(task* task)
742
742
/* Notify thread pool that current thread is going to wait */
743
743
void thread_pool_generic::wait_begin ()
744
744
{
745
- if (!tls_worker_data || tls_worker_data->is_long_task () || tls_worker_data-> is_waiting () )
745
+ if (!tls_worker_data || tls_worker_data->is_long_task ())
746
746
return ;
747
747
std::unique_lock<std::mutex> lk (m_mtx);
748
748
tls_worker_data->m_state |= worker_data::WAITING;
749
749
m_waiting_task_count++;
750
750
751
751
/* Maintain concurrency */
752
- if (m_task_queue.empty ())
753
- return ;
754
- if (m_active_threads.size () - m_long_tasks_count - m_waiting_task_count < m_concurrency)
755
- maybe_wake_or_create_thread ();
752
+ maybe_wake_or_create_thread ();
756
753
}
757
754
758
755
Original file line number Diff line number Diff line change 1
1
#include < tpool.h>
2
2
3
+ namespace tpool
4
+ {
3
5
static thread_local tpool::thread_pool* tls_thread_pool;
4
6
5
7
extern " C" void set_tls_pool (tpool::thread_pool* pool)
@@ -18,4 +20,6 @@ extern "C" void tpool_wait_end()
18
20
{
19
21
if (tls_thread_pool)
20
22
tls_thread_pool->wait_end ();
21
- }
23
+ }
24
+
25
+ }
You can’t perform that action at this time.
0 commit comments