diff --git a/examples/SolverComparer.cpp b/examples/SolverComparer.cpp index cc5fdb26d..0845b42ae 100644 --- a/examples/SolverComparer.cpp +++ b/examples/SolverComparer.cpp @@ -221,7 +221,7 @@ int main(int argc, char *argv[]) { #ifdef GTSAM_USE_TBB arena.execute([&]{ - tg.run([&]{ + tg.run_and_wait([&]{ #endif // Run mode if(incremental) diff --git a/examples/TimeTBB.cpp b/examples/TimeTBB.cpp index c25a19107..4bc5144f4 100644 --- a/examples/TimeTBB.cpp +++ b/examples/TimeTBB.cpp @@ -89,10 +89,9 @@ map testWithoutMemoryAllocation(int num_threads) // Run parallel code (as a task group) inside of task arena arena.execute([&]{ - tg.run([&]{ + tg.run_and_wait([&]{ tbb::parallel_for(tbb::blocked_range(0, numberOfProblems), WorkerWithoutAllocation(results)); }); - tg.wait(); }); tbb::tick_count t1 = tbb::tick_count::now(); @@ -154,10 +153,9 @@ map testWithMemoryAllocation(int num_threads) // Run parallel code (as a task group) inside of task arena arena.execute([&]{ - tg.run([&]{ + tg.run_and_wait([&]{ tbb::parallel_for(tbb::blocked_range(0, numberOfProblems), WorkerWithAllocation(results)); }); - tg.wait(); }); tbb::tick_count t1 = tbb::tick_count::now();