]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Replace Threads::mutex by std::mutex
authorDaniel Arndt <arndtd@ornl.gov>
Tue, 7 Jan 2020 14:54:43 +0000 (09:54 -0500)
committerDaniel Arndt <arndtd@ornl.gov>
Mon, 13 Jan 2020 21:29:12 +0000 (14:29 -0700)
18 files changed:
include/deal.II/base/flow_function.h
include/deal.II/base/function_cspline.h
include/deal.II/base/incremental_function.h
include/deal.II/base/parallel.h
include/deal.II/base/timer.h
include/deal.II/fe/fe_poly_tensor.h
include/deal.II/fe/fe_system.h
include/deal.II/fe/mapping_fe_field.h
include/deal.II/fe/mapping_q_eulerian.h
include/deal.II/lac/block_matrix_base.h
include/deal.II/lac/la_parallel_vector.h
include/deal.II/lac/lapack_full_matrix.h
include/deal.II/lac/precondition.h
include/deal.II/lac/scalapack.h
include/deal.II/lac/swappable_vector.h
include/deal.II/lac/vector_memory.h
include/deal.II/lac/vector_memory.templates.h
include/deal.II/matrix_free/dof_info.templates.h

index 8486837f4d690847af5d1e36d981b45003ce5e06..9696784f330e1b04427857dfc4708ffd720f554b 100644 (file)
@@ -128,7 +128,7 @@ namespace Functions
     /**
      * A mutex that guards the following scratch arrays.
      */
-    mutable Threads::Mutex mutex;
+    mutable std::mutex mutex;
 
     /**
      * Auxiliary values for the usual Function interface.
index c058669c9ea3dc7d06942935543ae5a4c7ff7914..febff9b51bc8efe5da6e62541b461c8b15fdff0f 100644 (file)
@@ -132,7 +132,7 @@ namespace Functions
     /**
      * A mutex for accelerator object.
      */
-    mutable Threads::Mutex acc_mutex;
+    mutable std::mutex acc_mutex;
   };
 } // namespace Functions
 
index dfb8a6e43f25d72c592c4e6e087d986761a16844..068024917531c17116c59bcf4a7585b5d5078d92 100644 (file)
@@ -120,7 +120,7 @@ namespace Functions
     /**
      * Thread mutex for supporting evaluation in multi-threaded contexts.
      */
-    mutable Threads::Mutex mutex;
+    mutable std::mutex mutex;
   };
 
 } // namespace Functions
index 07fc76b72c5d590fae6aab535d2babbc5566c373..7376ec70fe9e061577e242e4006c5b958224b0a4 100644 (file)
@@ -773,7 +773,7 @@ namespace parallel
       /**
        * A mutex to guard the access to the in_use flag.
        */
-      dealii::Threads::Mutex mutex;
+      std::mutex mutex;
 #endif
     };
   } // namespace internal
index fdc03bb4f8527d84a51f87e76248e9981c63caed..8b6b74d9087b782ec5fddb0bb2cce5f93d3f01bb 100644 (file)
@@ -911,7 +911,7 @@ private:
    * A lock that makes sure that this class gives reasonable results even when
    * used with several threads.
    */
-  Threads::Mutex mutex;
+  std::mutex mutex;
 };
 
 
index fef42ba72cbd72bf3cf55fef0f924efb4f09eb9e..294bc6e80dfe9ab52da501f64b9bc679a97c8765 100644 (file)
@@ -492,7 +492,7 @@ protected:
   /**
    * A mutex to be used to guard access to the variables below.
    */
-  mutable Threads::Mutex cache_mutex;
+  mutable std::mutex cache_mutex;
 
   /**
    * If a shape function is computed at a single point, we must compute all of
index 3500beb7382abedc576716409f2b3fc3707d06cb..cb5777bb36f5b9813e5c971a9cb2d706f8eef292 100644 (file)
@@ -1231,7 +1231,7 @@ private:
   /**
    * Mutex for protecting initialization of restriction and embedding matrix.
    */
-  mutable Threads::Mutex mutex;
+  mutable std::mutex mutex;
 
   friend class FE_Enriched<dim, spacedim>;
 };
index 4930988eca3c0abe8cdebd4bfbfd4a60bdb6face..4f1e23d22fa92db7f93fdeaa6e22a69f28a58b0b 100644 (file)
@@ -634,7 +634,7 @@ private:
   /**
    * A variable to guard access to the fe_values variable.
    */
-  mutable Threads::Mutex fe_values_mutex;
+  mutable std::mutex fe_values_mutex;
 
   void
   compute_data(const UpdateFlags      update_flags,
index bd6ce6b776dd41e236cb8f554d98e8cebfe209f4..670a4d89f36b068fc79f56345f6be445f75ec28f 100644 (file)
@@ -266,7 +266,7 @@ private:
     /**
      * A variable to guard access to the fe_values variable.
      */
-    mutable Threads::Mutex fe_values_mutex;
+    mutable std::mutex fe_values_mutex;
   };
 };
 
index 9e76467aaca12364908e30e0757f547fe362f76c..43368dd2ed3da9cd428543218e08b05ee5eb4319 100644 (file)
@@ -1040,11 +1040,11 @@ private:
      * A mutex variable used to guard access to the member variables of this
      * structure;
      */
-    Threads::Mutex mutex;
+    std::mutex mutex;
 
     /**
      * Copy operator. This is needed because the default copy operator of this
-     * class is deleted (since Threads::Mutex is not copyable) and hence the
+     * class is deleted (since std::mutex is not copyable) and hence the
      * default copy operator of the enclosing class is also deleted.
      *
      * The implementation here simply does nothing -- TemporaryData objects
index adc4460a78ed1e50733c3ca89252c5ee8c1c6839..b8a2acfe19d64b3b9fdadfa3fc7d1d19b3b82d2d 100644 (file)
@@ -1393,7 +1393,7 @@ namespace LinearAlgebra
        * update_ghost_values functions give reasonable results also when used
        * with several threads.
        */
-      mutable Threads::Mutex mutex;
+      mutable std::mutex mutex;
 
       /**
        * A helper function that clears the compress_requests and
index dfba3c534c31ee8791b88f596c340965652dfe37..10c885bb89e72179b262695f0d827a1295bd9adb 100644 (file)
@@ -1003,7 +1003,7 @@ private:
   /**
    * Thread mutex.
    */
-  mutable Threads::Mutex mutex;
+  mutable std::mutex mutex;
 };
 
 
index 185a7dce5c933a8b0b3963f8a42b07623de8497c..a02eacb1d77598263b7cdafe18ace86f2d3d8f2c 100644 (file)
@@ -1210,7 +1210,7 @@ private:
    * A mutex to avoid that multiple vmult() invocations by different threads
    * overwrite the temporary vectors.
    */
-  mutable Threads::Mutex mutex;
+  mutable std::mutex mutex;
 
   /**
    * Initializes the factors theta and delta based on an eigenvalue
index 857922232165ebea99ad9b3ee8a99e5cdef8dbda..50df0d3b9293570f7f4ea5af208bfca0c0945625 100644 (file)
@@ -985,7 +985,7 @@ private:
   /**
    * Thread mutex.
    */
-  mutable Threads::Mutex mutex;
+  mutable std::mutex mutex;
 };
 
 // ----------------------- inline functions ----------------------------
index 9ce7a360131404c7797a7c4aa2a0cac846ea8e46..6c45f3f7a58b82ebff41fd8805b2cf5c61695c3e 100644 (file)
@@ -203,7 +203,7 @@ private:
    * If not in MT mode, then the class used here is empty, and we can as well
    * get away with it.
    */
-  Threads::Mutex lock;
+  std::mutex lock;
 
   /**
    * Flag by which the @p alert function signifies that the data has been
index eabcada2524f5e5a21245cacaca3cee70a192504..cc721bde3a059da8074ec0893f1eaa440a4814a2 100644 (file)
@@ -462,7 +462,7 @@ private:
    * Mutex to synchronize access to internal data of this object from multiple
    * threads.
    */
-  static Threads::Mutex mutex;
+  static std::mutex mutex;
 };
 
 
index f9081291c724c0832bfcfaa43080d71efb2dd90b..beb406df7255258cc14c79ec345f6e0fc9ebaf02 100644 (file)
@@ -38,7 +38,7 @@ GrowingVectorMemory<VectorType>::get_pool()
 
 
 template <typename VectorType>
-Threads::Mutex GrowingVectorMemory<VectorType>::mutex;
+std::mutex GrowingVectorMemory<VectorType>::mutex;
 
 
 
index d8f2ffa9ea540aac9ba3cf7092cc848077c45288..ee12196d50171fd00b9296f00640ae161f663bbd 100644 (file)
@@ -1442,11 +1442,11 @@ namespace internal
       static constexpr unsigned int bucket_size_threading = 256;
 
       void
-      compute_row_lengths(const unsigned int           begin,
-                          const unsigned int           end,
-                          const DoFInfo &              dof_info,
-                          std::vector<Threads::Mutex> &mutexes,
-                          std::vector<unsigned int> &  row_lengths)
+      compute_row_lengths(const unsigned int         begin,
+                          const unsigned int         end,
+                          const DoFInfo &            dof_info,
+                          std::vector<std::mutex> &  mutexes,
+                          std::vector<unsigned int> &row_lengths)
       {
         std::vector<unsigned int> scratch;
         const unsigned int n_components = dof_info.start_components.back();
@@ -1485,7 +1485,7 @@ namespace internal
                              const unsigned int               end,
                              const DoFInfo &                  dof_info,
                              const std::vector<unsigned int> &row_lengths,
-                             std::vector<Threads::Mutex> &    mutexes,
+                             std::vector<std::mutex> &        mutexes,
                              dealii::SparsityPattern &        connectivity_dof)
       {
         std::vector<unsigned int> scratch;
@@ -1568,9 +1568,9 @@ namespace internal
         ++n_rows;
 
       // first determine row lengths
-      std::vector<unsigned int>   row_lengths(n_rows);
-      std::vector<Threads::Mutex> mutexes(
-        n_rows / internal::bucket_size_threading + 1);
+      std::vector<unsigned int> row_lengths(n_rows);
+      std::vector<std::mutex> mutexes(n_rows / internal::bucket_size_threading +
+                                      1);
       parallel::apply_to_subranges(0,
                                    task_info.n_active_cells,
                                    [this,

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.