]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use TaskResult::emplace_object() in class Lazy. 17683/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Wed, 21 Aug 2024 22:20:01 +0000 (16:20 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Sat, 7 Sep 2024 19:39:39 +0000 (13:39 -0600)
include/deal.II/base/lazy.h

index 37a066b743f75b94f4ae031dcde9bf1e828787ca..ff22a806a7f84ba8c7bb4d6825e21ac98ad2cdd3 100644 (file)
@@ -299,9 +299,7 @@ inline Lazy<T>::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<T> &Lazy<T>::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
     {

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.