Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions include/exec/static_thread_pool.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -930,8 +930,10 @@ namespace experimental::execution
for (std::uint32_t i = 0; i < tasks.size(); ++i)
{
std::uint32_t index = i % this->available_parallelism();
queue.queues_[index].push_front(&tasks[i]);
thread_states_[index]->notify();
if (queue.queues_[index].push_front(&tasks[i]))
{
thread_states_[index]->notify();
}
}
// At this point the calling thread can exit and the pool will take over.
// Ultimately, the last completing thread passes the result forward.
Expand Down
Loading