]> https://gitweb.dealii.org/ - dealii.git/commitdiff
provide Thread also without TBB 10410/head
authorTimo Heister <timo.heister@gmail.com>
Thu, 28 May 2020 19:45:33 +0000 (15:45 -0400)
committerTimo Heister <timo.heister@gmail.com>
Thu, 28 May 2020 19:45:33 +0000 (15:45 -0400)
There is no reason to guard ThreadDescriptor and Threads with
DEAL_II_WITH_THREADS as this is equal to DEAL_II_WITH_TBB.

include/deal.II/base/thread_management.h

index de868ab06447f4fce1a664092bf3e151f3d78f2c..d50787e448423ceddce2921f8109d4218aa2c06c 100644 (file)
@@ -372,8 +372,6 @@ namespace Threads
 
   namespace internal
   {
-#  ifdef DEAL_II_WITH_THREADS
-
     /**
      * A class that represents threads. For each thread, we create exactly one
      * of these objects -- exactly one because it carries the returned value
@@ -516,45 +514,6 @@ namespace Threads
           }
       }
     };
-
-#  else
-    /**
-     * A class that represents threads. For each thread, we create exactly one
-     * of these objects -- exactly one because it carries the returned value
-     * of the function called on the thread.
-     *
-     * While we have only one of these objects per thread, several
-     * Threads::Thread objects may refer to this descriptor.
-     */
-    template <typename RT>
-    struct ThreadDescriptor
-    {
-      /**
-       * An object that will hold the value returned by the function called on
-       * the thread.
-       */
-      std::shared_ptr<return_value<RT>> ret_val;
-
-      /**
-       * Start the thread and let it put its return value into the ret_val
-       * object.
-       */
-      void
-      start(const std::function<RT()> &function)
-      {
-        ret_val = std::make_shared<return_value<RT>>();
-        call(function, *ret_val);
-      }
-
-      /**
-       * Wait for the thread to end.
-       */
-      void
-      join()
-      {}
-    };
-
-#  endif
   } // namespace internal
 
 

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.