Skip to content

Commit

Permalink
Fix task_task_arena for one thread env (#1131)
Browse files Browse the repository at this point in the history
Signed-off-by: pavelkumbrasev <pavel.kumbrasev@intel.com>
  • Loading branch information
pavelkumbrasev authored Jun 13, 2023
1 parent f8f7f73 commit 3f657a3
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions test/tbb/test_task_arena.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1987,14 +1987,13 @@ TEST_CASE("worker threads occupy slots in correct range") {
arena.initialize(1, 0);
}

tbb::task_group tg;
std::atomic<int> counter{0};
for (auto& arena : arenas) {
arena.execute([&] {
tg.run([] {
CHECK(tbb::this_task_arena::current_thread_index() == 0);
});
arena.enqueue([&] {
CHECK(tbb::this_task_arena::current_thread_index() == 0);
++counter;
});
}

tg.wait();
while (counter < 42) { utils::yield(); }
}

0 comments on commit 3f657a3

Please sign in to comment.