From 3fdb736ad48e5ace68fc99b3772a55d550e2aca3 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Wed, 21 Aug 2024 16:20:01 -0600 Subject: [PATCH] Use TaskResult::emplace_object() in class Lazy. --- include/deal.II/base/lazy.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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 { -- 2.39.5