From: Wolfgang Bangerth Date: Wed, 21 Aug 2024 22:20:01 +0000 (-0600) Subject: Use TaskResult::emplace_object() in class Lazy. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F17683%2Fhead;p=dealii.git Use TaskResult::emplace_object() in class Lazy. --- diff --git a/include/deal.II/base/lazy.h b/include/deal.II/base/lazy.h index 37a066b743..ff22a806a7 100644 --- a/include/deal.II/base/lazy.h +++ b/include/deal.II/base/lazy.h @@ -299,9 +299,7 @@ inline Lazy::Lazy(const Lazy &other) if (other.has_value()) { object_is_initialized.store(true); - task_result = - Threads::new_task([&other]() -> T { return other.value(); }); - task_result.join(); + task_result.emplace_object(other.value()); } else object_is_initialized.store(false); @@ -333,8 +331,7 @@ inline Lazy &Lazy::operator=(const Lazy &other) if (other.has_value()) { object_is_initialized.store(true); - task_result = - Threads::new_task([&other]() -> T { return other.value(); }); + task_result.emplace_object(other.value()); } else {