]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Provide copy operator and initialize member variables. 3494/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Mon, 7 Nov 2016 17:33:14 +0000 (10:33 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Mon, 7 Nov 2016 17:33:14 +0000 (10:33 -0700)
include/deal.II/base/thread_management.h

index ae1ece126394d9d5728332e7e8ff355fbe4eb59e..4c61e272b3decda843b6458958ad69eff36b2750 100644 (file)
@@ -2859,6 +2859,13 @@ namespace Threads
        */
       ~TaskDescriptor ();
 
+      /**
+       * Copy operator. Throws an exception since we want to make sure that
+       * each TaskDescriptor object corresponds to exactly one task.
+       */
+      TaskDescriptor &
+      operator = (const TaskDescriptor &);
+
       /**
        * Queue up the task to the scheduler. We need to do this in a separate
        * function since the new tasks needs to access objects from the current
@@ -2908,6 +2915,8 @@ namespace Threads
 
     template <typename RT>
     TaskDescriptor<RT>::TaskDescriptor ()
+      :
+      task_is_done (false)
     {
       Assert (false, ExcInternalError());
     }
@@ -2916,7 +2925,11 @@ namespace Threads
 
     template <typename RT>
     TaskDescriptor<RT>::TaskDescriptor (const TaskDescriptor &)
+      :
+      task_is_done (false)
     {
+      // we shouldn't be getting here -- task descriptors
+      // can't be copied
       Assert (false, ExcInternalError());
     }
 
@@ -2945,6 +2958,17 @@ namespace Threads
     }
 
 
+    template <typename RT>
+    TaskDescriptor<RT> &
+    TaskDescriptor<RT>::operator = (const TaskDescriptor &)
+    {
+      // we shouldn't be getting here -- task descriptors
+      // can't be copied
+      Assert (false, ExcInternalError());
+      return *this;
+    }
+
+
     template <typename RT>
     inline
     void

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.