]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Deprecate the new_thread() functions.
authorWolfgang Bangerth <bangerth@colostate.edu>
Fri, 24 Dec 2021 04:31:03 +0000 (21:31 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Fri, 24 Dec 2021 04:31:03 +0000 (21:31 -0700)
include/deal.II/base/thread_management.h

index d462f14b1b3fc3d7e4e8d8cfc3ba4dedea265952..b8484a1b2abbaebe0e6b4408dfdbb976e2108e25 100644 (file)
@@ -753,10 +753,12 @@ namespace Threads
    * function object without arguments and returning an object of type RT (or
    * void).
    *
+   * @deprecated Use std::thread or std::jthread instead.
+   *
    * @ingroup threads
    */
   template <typename RT>
-  inline Thread<RT>
+  DEAL_II_DEPRECATED inline Thread<RT>
   new_thread(const std::function<RT()> &function)
   {
     return Thread<RT>(function);
@@ -826,10 +828,12 @@ namespace Threads
    *   or capture have a lifetime that extends at least until the time
    *   where the thread finishes.
    *
+   * @deprecated Use std::thread or std::jthread instead.
+   *
    * @ingroup CPP11
    */
   template <typename FunctionObjectType>
-  inline auto
+  DEAL_II_DEPRECATED inline auto
   new_thread(FunctionObjectType function_object)
     -> Thread<decltype(function_object())>
   {
@@ -843,10 +847,12 @@ namespace Threads
    * Overload of the new_thread function for non-member or static member
    * functions.
    *
+   * @deprecated Use std::thread or std::jthread instead.
+   *
    * @ingroup threads
    */
   template <typename RT, typename... Args>
-  inline Thread<RT>
+  DEAL_II_DEPRECATED inline Thread<RT>
   new_thread(RT (*fun_ptr)(Args...), typename identity<Args>::type... args)
   {
     auto dummy = std::make_tuple(internal::maybe_make_ref<Args>::act(args)...);
@@ -859,10 +865,12 @@ namespace Threads
   /**
    * Overload of the non-const new_thread function for member functions.
    *
+   * @deprecated Use std::thread or std::jthread instead.
+   *
    * @ingroup threads
    */
   template <typename RT, typename C, typename... Args>
-  inline Thread<RT>
+  DEAL_II_DEPRECATED inline Thread<RT>
   new_thread(RT (C::*fun_ptr)(Args...),
              typename identity<C>::type &c,
              typename identity<Args>::type... args)
@@ -875,10 +883,12 @@ namespace Threads
   /**
    * Overload of the new_thread function for const member functions.
    *
+   * @deprecated Use std::thread or std::jthread instead.
+   *
    * @ingroup threads
    */
   template <typename RT, typename C, typename... Args>
-  inline Thread<RT>
+  DEAL_II_DEPRECATED inline Thread<RT>
   new_thread(RT (C::*fun_ptr)(Args...) const,
              typename identity<const C>::type &c,
              typename identity<Args>::type... args)

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.