Commit 2faad2e8 by FritzFlorian

Fix typo in invoke_parallel.

This resulted from an merge gone wrong.
parent c825214a
Pipeline #1164 passed with stages
in 3 minutes 44 seconds
...@@ -22,7 +22,7 @@ inline void run_body(const Body &internal_body, const abstract_task::id &id) { ...@@ -22,7 +22,7 @@ inline void run_body(const Body &internal_body, const abstract_task::id &id) {
if (current_task->unique_id() == id) { if (current_task->unique_id() == id) {
internal_body(); internal_body();
} else { } else {
fork_join_lambda_by_reference<Body> root_body(&internal_body); fork_join_lambda_by_reference<Body> root_body(internal_body);
fork_join_task root_task{&root_body, id}; fork_join_task root_task{&root_body, id};
scheduler::execute_task(root_task); scheduler::execute_task(root_task);
} }
...@@ -36,12 +36,13 @@ void invoke_parallel(const Function1 &function1, const Function2 &function2) { ...@@ -36,12 +36,13 @@ void invoke_parallel(const Function1 &function1, const Function2 &function2) {
using namespace ::pls::internal::base; using namespace ::pls::internal::base;
static abstract_task::id id = unique_id::create<Function1, Function2>(); static abstract_task::id id = unique_id::create<Function1, Function2>();
auto internal_body = [&](fork_join_sub_task *this_task) { auto internal_body = [&]() {
auto current_task = fork_join_sub_task::current();
auto sub_task_2 = fork_join_lambda_by_reference<Function2>(function2); auto sub_task_2 = fork_join_lambda_by_reference<Function2>(function2);
this_task->spawn_child(sub_task_2); current_task->spawn_child(sub_task_2);
function1(); // Execute first function 'inline' without spawning a sub_task object function1(); // Execute first function 'inline' without spawning a sub_task object
this_task->wait_for_all(); current_task->wait_for_all();
}; };
internal::run_body(internal_body, id); internal::run_body(internal_body, id);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment