]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
ThreadMutex -> Mutex
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 13 Dec 2012 17:59:21 +0000 (17:59 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 13 Dec 2012 17:59:21 +0000 (17:59 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_deprecated@27808 0785d39b-7218-0410-832d-ea1e28bc413d

14 files changed:
deal.II/include/deal.II/base/timer.h
deal.II/include/deal.II/fe/mapping_q_eulerian.h
deal.II/include/deal.II/lac/parallel_vector.h
deal.II/include/deal.II/lac/parallel_vector.templates.h
deal.II/include/deal.II/lac/sparse_direct.h
deal.II/include/deal.II/lac/swappable_vector.h
deal.II/include/deal.II/lac/swappable_vector.templates.h
deal.II/include/deal.II/lac/vector_memory.h
deal.II/source/dofs/dof_tools.cc
deal.II/source/fe/fe_tools.cc
deal.II/source/fe/mapping_q_eulerian.cc
deal.II/source/lac/sparse_direct.cc
deal.II/source/lac/vector_memory.cc
deal.II/source/numerics/matrix_tools.cc

index 553445e70fa7c7bdba7c388d22fa43c6a3802297..fed57a32bd70704b4fa3423c67aafa668809346c 100644 (file)
@@ -516,7 +516,7 @@ private:
    * class gives reasonable results even
    * when used with several threads.
    */
-  Threads::ThreadMutex mutex;
+  Threads::Mutex mutex;
 };
 
 
index 54177ab37b006fd9ee7ac086756604a2dd9ae7c5..e748d1520c2cc9a7dc97e5088679782a17eb535b 100644 (file)
@@ -220,7 +220,7 @@ private:
    * A variable to guard access to
    * the fe_values variable.
    */
-  mutable Threads::ThreadMutex fe_values_mutex;
+  mutable Threads::Mutex fe_values_mutex;
 
   /**
    * Compute the positions of the
index 69e2a7a33b53743ee128642e727e4d7987db3afd..48d233401aa6edbeeed2f3c4c9c89a50379dbe33 100644 (file)
@@ -947,7 +947,7 @@ namespace parallel
        * when used with several
        * threads.
        */
-      mutable Threads::ThreadMutex mutex;
+      mutable Threads::Mutex mutex;
 
       /**
        * A helper function that clears the
index d841e0a1f5813d4a7f3f4f10fe7ae3e547185ca0..10b601f0cd66296f080b9768d3dbbb67e49a18b0 100644 (file)
@@ -211,7 +211,7 @@ namespace parallel
         return;
 
       // make this function thread safe
-      Threads::ThreadMutex::ScopedLock lock (mutex);
+      Threads::Mutex::ScopedLock lock (mutex);
 
       const unsigned int n_import_targets = part.import_targets().size();
       const unsigned int n_ghost_targets  = part.ghost_targets().size();
@@ -292,7 +292,7 @@ namespace parallel
         return;
 
       // make this function thread safe
-      Threads::ThreadMutex::ScopedLock lock (mutex);
+      Threads::Mutex::ScopedLock lock (mutex);
 
       const unsigned int n_import_targets = part.import_targets().size();
       const unsigned int n_ghost_targets  = part.ghost_targets().size();
@@ -357,7 +357,7 @@ namespace parallel
         return;
 
       // make this function thread safe
-      Threads::ThreadMutex::ScopedLock lock (mutex);
+      Threads::Mutex::ScopedLock lock (mutex);
 
       const unsigned int n_import_targets = part.import_targets().size();
       const unsigned int n_ghost_targets = part.ghost_targets().size();
@@ -452,7 +452,7 @@ namespace parallel
       if (update_ghost_values_requests.size() > 0)
         {
           // make this function thread safe
-          Threads::ThreadMutex::ScopedLock lock (mutex);
+          Threads::Mutex::ScopedLock lock (mutex);
 
           int ierr;
           ierr = MPI_Waitall (update_ghost_values_requests.size(),
index 03b3e1ce078e67a76e269376f6c8dc3ba6d549ca..db7c679161dd2380b03c5fbbdcde3a8a58d520ec 100644 (file)
@@ -331,7 +331,7 @@ public:
    * this class for more
    * information.
    */
-  Threads::ThreadMutex &get_synchronisation_lock () const;
+  Threads::Mutex &get_synchronisation_lock () const;
 
   /** @addtogroup Exceptions
    * @{ */
@@ -520,8 +520,8 @@ private:
    * Mutexes for synchronising access
    * to this class.
    */
-  static Threads::ThreadMutex static_synchronisation_lock;
-  mutable Threads::ThreadMutex non_static_synchronisation_lock;
+  static Threads::Mutex static_synchronisation_lock;
+  mutable Threads::Mutex non_static_synchronisation_lock;
 
   /**
    * Fill the <tt>A</tt> array from the
@@ -801,7 +801,7 @@ public:
    * this class for more
    * information.
    */
-  Threads::ThreadMutex &get_synchronisation_lock () const;
+  Threads::Mutex &get_synchronisation_lock () const;
 
   /** @addtogroup Exceptions
    * @{ */
@@ -948,7 +948,7 @@ private:
    * Mutex for synchronising access
    * to this class.
    */
-  static Threads::ThreadMutex synchronisation_lock;
+  static Threads::Mutex synchronisation_lock;
 
   /**
    * Fill the <tt>A</tt> array from the
index 47464dd98edccf05adf6592a667f6306e15c7c32..02db61b6254705d5adfa7dda0e1e5ba397e01c7f 100644 (file)
@@ -253,7 +253,7 @@ private:
    * we can as well get away
    * with it.
    */
-  Threads::ThreadMutex lock;
+  Threads::Mutex lock;
 
   /**
    * Flag by which the @p alert
index be74ebbb7bf7b7ab1b2e3f66c85dde532b1f464c..215cd5a28a2ba71acea3b4e6090ef508f0668609 100644 (file)
@@ -66,7 +66,7 @@ SwappableVector<number>::operator= (const SwappableVector<number> &v)
   // if in MT mode, block all other
   // operations. if not in MT mode,
   // this is a no-op
-  Threads::ThreadMutex::ScopedLock lock(this->lock);
+  Threads::Mutex::ScopedLock lock(this->lock);
 
   Vector<number>::operator = (v);
   data_is_preloaded = false;
@@ -94,7 +94,7 @@ void SwappableVector<number>::swap_out (const std::string &name)
   // if in MT mode, block all other
   // operations. if not in MT mode,
   // this is a no-op
-  Threads::ThreadMutex::ScopedLock lock(this->lock);
+  Threads::Mutex::ScopedLock lock(this->lock);
 
   //  check that we have not called
   //  @p alert without the respective
@@ -208,7 +208,7 @@ void SwappableVector<number>::kill_file ()
   // (there should be none, but who
   // knows). if not in MT mode,
   // this is a no-op
-  Threads::ThreadMutex::ScopedLock lock(this->lock);
+  Threads::Mutex::ScopedLock lock(this->lock);
 
   // this is too bad: someone
   // requested the vector in advance,
index ec8926a42cf016d9fd279b27d6d100b98bf31f4c..a5f35ac422eb423489940d96824b69c4d759de52 100644 (file)
@@ -396,7 +396,7 @@ private:
    * internal data of this object
    * from multiple threads.
    */
-  static Threads::ThreadMutex mutex;
+  static Threads::Mutex mutex;
 };
 
 /*@}*/
index d3de9cdec0da1d2b84f7b263c5323fd93308d778..783311e15208d7f49889f051d315d41c3bceaa65 100644 (file)
@@ -4720,8 +4720,8 @@ namespace DoFTools
                   // since it should happen rather rarely that there are
                   // several threads operating on different intergrid
                   // weights, have only one mutex for all of them
-                  static Threads::ThreadMutex mutex;
-                  Threads::ThreadMutex::ScopedLock lock (mutex);
+                  static Threads::Mutex mutex;
+                  Threads::Mutex::ScopedLock lock (mutex);
                   for (unsigned int i=0; i<global_parameter_representation.size(); ++i)
                     // set this weight if it belongs to a parameter dof.
                     if (weight_mapping[i] != -1)
index 931cadf6607403369382ea3762562e1033418266..b1d9bd01589859768762b8c36d938d74d107e553 100644 (file)
@@ -175,7 +175,7 @@ namespace
   // linking libraries for more than
   // one space dimension together
   static
-  Threads::ThreadMutex fe_name_map_lock;
+  Threads::Mutex fe_name_map_lock;
 
   // This is the map used by
   // FETools::get_fe_from_name and
@@ -1951,7 +1951,7 @@ namespace FETools
     // operation of this function;
     // for this, acquire the lock
     // until we quit this function
-    Threads::ThreadMutex::ScopedLock lock(fe_name_map_lock);
+    Threads::Mutex::ScopedLock lock(fe_name_map_lock);
 
     Assert(fe_name_map_1d.find(name) == fe_name_map_1d.end(),
            ExcMessage("Cannot change existing element in finite element name list"));
@@ -1981,7 +1981,7 @@ namespace FETools
     // operation of this function;
     // for this, acquire the lock
     // until we quit this function
-    Threads::ThreadMutex::ScopedLock lock(fe_name_map_lock);
+    Threads::Mutex::ScopedLock lock(fe_name_map_lock);
 
     Assert(fe_name_map_2d.find(name) == fe_name_map_2d.end(),
            ExcMessage("Cannot change existing element in finite element name list"));
@@ -2010,7 +2010,7 @@ namespace FETools
     // operation of this function;
     // for this, acquire the lock
     // until we quit this function
-    Threads::ThreadMutex::ScopedLock lock(fe_name_map_lock);
+    Threads::Mutex::ScopedLock lock(fe_name_map_lock);
 
     Assert(fe_name_map_3d.find(name) == fe_name_map_3d.end(),
            ExcMessage("Cannot change existing element in finite element name list"));
@@ -2200,7 +2200,7 @@ namespace FETools
           {
             // Make sure no other thread
             // is just adding an element
-            Threads::ThreadMutex::ScopedLock lock (fe_name_map_lock);
+            Threads::Mutex::ScopedLock lock (fe_name_map_lock);
 
             AssertThrow (fe_name_map.find(name_part) != fe_name_map.end(),
                          ExcInvalidFEName(name));
index 6e6703ad7155e7929a3e58d3ba3b70eb98c6fb81..0cad0783f27faca674760696b0d55f9107a84370 100644 (file)
@@ -163,7 +163,7 @@ compute_mapping_support_points
   // fe_values variable isn't used
   // simulatenously from different
   // threads
-  Threads::ThreadMutex::ScopedLock lock(fe_values_mutex);
+  Threads::Mutex::ScopedLock lock(fe_values_mutex);
   fe_values.reinit(dof_cell);
   fe_values.get_function_values(*euler_vector, shift_vector);
 
index b999da0a920bf80f394cfcc450c3bb39e13acc7b..d13f996cf66e8311190b19c60799faac1bd05e6e 100644 (file)
@@ -254,7 +254,7 @@ namespace
 
 /* -------------------------- MA27 ---------------------------- */
 
-Threads::ThreadMutex SparseDirectMA27::static_synchronisation_lock;
+Threads::Mutex SparseDirectMA27::static_synchronisation_lock;
 
 
 struct SparseDirectMA27::DetachedModeData
@@ -264,7 +264,7 @@ struct SparseDirectMA27::DetachedModeData
    * thread is currently talking
    * through the pipe.
    */
-  Threads::ThreadMutex mutex;
+  Threads::Mutex mutex;
 
   /**
    * File handles for the pipe
@@ -387,7 +387,7 @@ SparseDirectMA27::~SparseDirectMA27()
     if (detached_mode_data != 0)
       {
         // close down client
-        Threads::ThreadMutex::ScopedLock lock (detached_mode_data->mutex);
+        Threads::Mutex::ScopedLock lock (detached_mode_data->mutex);
         // Assign the result of write
         // and reset the variable to
         // avoid compiler warnings
@@ -854,7 +854,7 @@ SparseDirectMA27::memory_consumption () const
 
 
 
-Threads::ThreadMutex &
+Threads::Mutex &
 SparseDirectMA27::get_synchronisation_lock () const
 {
   if (detached_mode)
@@ -932,7 +932,7 @@ void SparseDirectMA27::call_ma27ad (const unsigned int *N,
                         IKEEP, IW1, NSTEPS, IFLAG);
   else
     {
-      Threads::ThreadMutex::ScopedLock lock (detached_mode_data->mutex);
+      Threads::Mutex::ScopedLock lock (detached_mode_data->mutex);
       // first write the data we have
       // to push over, i.e. first
       // function index, then array
@@ -982,7 +982,7 @@ void SparseDirectMA27::call_ma27bd (const unsigned int *N,
       // basically, everything is
       // already over the line,
       // except for A and LA
-      Threads::ThreadMutex::ScopedLock lock (detached_mode_data->mutex);
+      Threads::Mutex::ScopedLock lock (detached_mode_data->mutex);
       detached_mode_data->put ("2", 1, "ACTION 2");
 
       detached_mode_data->put (LA, 1, "LA");
@@ -1030,7 +1030,7 @@ void SparseDirectMA27::call_ma27x1 (unsigned int *NRLNEC)
     HSL::MA27::ma27x1_ (NRLNEC);
   else
     {
-      Threads::ThreadMutex::ScopedLock lock (detached_mode_data->mutex);
+      Threads::Mutex::ScopedLock lock (detached_mode_data->mutex);
       // ma27x1 only reads data, so
       // don't send anything except
       // for the id
@@ -1047,7 +1047,7 @@ void SparseDirectMA27::call_ma27x2 (unsigned int *NIRNEC)
     HSL::MA27::ma27x2_ (NIRNEC);
   else
     {
-      Threads::ThreadMutex::ScopedLock lock (detached_mode_data->mutex);
+      Threads::Mutex::ScopedLock lock (detached_mode_data->mutex);
       // ma27x2 only reads data, so
       // don't send anything except
       // for the id
@@ -1064,7 +1064,7 @@ void SparseDirectMA27::call_ma27x3 (const unsigned int *LP)
     HSL::MA27::ma27x3_ (LP);
   else
     {
-      Threads::ThreadMutex::ScopedLock lock (detached_mode_data->mutex);
+      Threads::Mutex::ScopedLock lock (detached_mode_data->mutex);
       // ma27x2 only reads data, so
       // don't send anything except
       // for the id
@@ -1079,7 +1079,7 @@ void SparseDirectMA27::call_ma27x3 (const unsigned int *LP)
 
 /* -------------------------- MA47 ---------------------------- */
 
-Threads::ThreadMutex SparseDirectMA47::synchronisation_lock;
+Threads::Mutex SparseDirectMA47::synchronisation_lock;
 
 
 SparseDirectMA47::SparseDirectMA47 (const double LIW_factor_1,
@@ -1377,7 +1377,7 @@ SparseDirectMA47::memory_consumption () const
 
 
 
-Threads::ThreadMutex &
+Threads::Mutex &
 SparseDirectMA47::get_synchronisation_lock () const
 {
   return synchronisation_lock;
index b5019968f42e2833e57e0596e0edd5c674dc2d6b..2e138a26440389b84adb79969151ffcb020eb247 100644 (file)
@@ -31,7 +31,7 @@ template <typename VECTOR>
 typename GrowingVectorMemory<VECTOR>::Pool GrowingVectorMemory<VECTOR>::pool;
 
 template <typename VECTOR>
-Threads::ThreadMutex GrowingVectorMemory<VECTOR>::mutex;
+Threads::Mutex GrowingVectorMemory<VECTOR>::mutex;
 
 template <typename VECTOR>
 inline
@@ -96,7 +96,7 @@ GrowingVectorMemory<VECTOR>::GrowingVectorMemory (const unsigned int initial_siz
   current_alloc(0),
   log_statistics(log_statistics)
 {
-  Threads::ThreadMutex::ScopedLock lock(mutex);
+  Threads::Mutex::ScopedLock lock(mutex);
   pool.initialize(initial_size);
 }
 
@@ -123,7 +123,7 @@ inline
 VECTOR *
 GrowingVectorMemory<VECTOR>::alloc ()
 {
-  Threads::ThreadMutex::ScopedLock lock(mutex);
+  Threads::Mutex::ScopedLock lock(mutex);
   ++total_alloc;
   ++current_alloc;
   // see if there is a free vector
@@ -153,7 +153,7 @@ inline
 void
 GrowingVectorMemory<VECTOR>::free(const VECTOR *const v)
 {
-  Threads::ThreadMutex::ScopedLock lock(mutex);
+  Threads::Mutex::ScopedLock lock(mutex);
   for (typename std::vector<entry_type>::iterator i=pool.data->begin();
        i != pool.data->end(); ++i)
     {
@@ -174,7 +174,7 @@ inline
 void
 GrowingVectorMemory<VECTOR>::release_unused_memory ()
 {
-  Threads::ThreadMutex::ScopedLock lock(mutex);
+  Threads::Mutex::ScopedLock lock(mutex);
 
   std::vector<entry_type> new_data;
 
@@ -200,7 +200,7 @@ inline
 std::size_t
 GrowingVectorMemory<VECTOR>::memory_consumption () const
 {
-  Threads::ThreadMutex::ScopedLock lock(mutex);
+  Threads::Mutex::ScopedLock lock(mutex);
 
   std::size_t result = sizeof (*this);
   const typename std::vector<entry_type>::const_iterator
index 24bb447f4173e705a8dddca929862c9c5bfb8a21..7d97af1459ca89fba43837768172d081f14fb11c 100644 (file)
@@ -825,7 +825,7 @@ namespace MatrixCreator
                                    const Function<spacedim> *const coefficient,
                                    const std::vector<unsigned int> &component_mapping,
                                    const MatrixCreator::internal::IteratorRange<DoFHandler<dim,spacedim> >   range,
-                                   Threads::ThreadMutex      &mutex)
+                                   Threads::Mutex      &mutex)
     {
       // All assertions for this function
       // are in the calling function
@@ -1060,7 +1060,7 @@ namespace MatrixCreator
                                      dofs_on_face_vector.end());
 
               // lock the matrix
-              Threads::ThreadMutex::ScopedLock lock (mutex);
+              Threads::Mutex::ScopedLock lock (mutex);
               for (unsigned int i=0; i<dofs_per_cell; ++i)
                 {
                   if (dof_is_on_face[i] && dof_to_boundary_mapping[dofs[i]] != numbers::invalid_unsigned_int)
@@ -1093,7 +1093,7 @@ namespace MatrixCreator
                                         const Function<3> *const ,
                                         const std::vector<unsigned int> &,
                                         const MatrixCreator::internal::IteratorRange<DoFHandler<2,3> > ,
-                                        Threads::ThreadMutex &)
+                                        Threads::Mutex &)
     {
       Assert(false,ExcNotImplemented());
     }
@@ -1112,7 +1112,7 @@ namespace MatrixCreator
                                         const Function<3> *const ,
                                         const std::vector<unsigned int> &,
                                         const MatrixCreator::internal::IteratorRange<DoFHandler<1,3> > ,
-                                        Threads::ThreadMutex &)
+                                        Threads::Mutex &)
     {
       Assert(false,ExcNotImplemented());
     }
@@ -1177,7 +1177,7 @@ namespace MatrixCreator
 
     // mutex to synchronise access to
     // the matrix
-    Threads::ThreadMutex mutex;
+    Threads::Mutex mutex;
 
     typedef std_cxx1x::tuple<const Mapping<dim,spacedim> &,
             const DoFHandler<dim,spacedim> &,
@@ -1193,7 +1193,7 @@ namespace MatrixCreator
      const Function<spacedim> *const coefficient,
      const std::vector<unsigned int> &component_mapping,
      const MatrixCreator::internal::IteratorRange<DoFHandler<dim,spacedim> >   range,
-     Threads::ThreadMutex      &mutex);
+     Threads::Mutex      &mutex);
     create_boundary_mass_matrix_1_t p
       = &create_boundary_mass_matrix_1<dim,spacedim>;
 
@@ -1225,7 +1225,7 @@ namespace MatrixCreator
                                    const Function<spacedim> *const coefficient,
                                    const std::vector<unsigned int> &component_mapping,
                                    const MatrixCreator::internal::IteratorRange<hp::DoFHandler<dim,spacedim> >   range,
-                                   Threads::ThreadMutex      &mutex)
+                                   Threads::Mutex      &mutex)
     {
       const hp::MappingCollection<dim,spacedim> &mapping = std_cxx1x::get<0>(commons);
       const hp::DoFHandler<dim,spacedim> &dof = std_cxx1x::get<1>(commons);
@@ -1522,7 +1522,7 @@ namespace MatrixCreator
 #endif
 
               // lock the matrix
-              Threads::ThreadMutex::ScopedLock lock (mutex);
+              Threads::Mutex::ScopedLock lock (mutex);
               for (unsigned int i=0; i<dofs_per_cell; ++i)
                 for (unsigned int j=0; j<dofs_per_cell; ++j)
                   if (dof_is_on_face[i] && dof_is_on_face[j])
@@ -1657,7 +1657,7 @@ namespace MatrixCreator
 
     // mutex to synchronise access to
     // the matrix
-    Threads::ThreadMutex mutex;
+    Threads::Mutex mutex;
 
     // then assemble in parallel
     typedef void (*create_boundary_mass_matrix_1_t)
@@ -1669,7 +1669,7 @@ namespace MatrixCreator
      const Function<spacedim> *const coefficient,
      const std::vector<unsigned int> &component_mapping,
      const MatrixCreator::internal::IteratorRange<hp::DoFHandler<dim,spacedim> >   range,
-     Threads::ThreadMutex      &mutex);
+     Threads::Mutex      &mutex);
     create_boundary_mass_matrix_1_t p = &create_boundary_mass_matrix_1<dim,spacedim>;
 
 //TODO: Use WorkStream here

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.