From 2500b7285892c2e7c779b7730772a25e7faa8d93 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Thu, 13 Dec 2012 17:59:21 +0000 Subject: [PATCH] ThreadMutex -> Mutex git-svn-id: https://svn.dealii.org/branches/branch_deprecated@27808 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/include/deal.II/base/timer.h | 2 +- .../include/deal.II/fe/mapping_q_eulerian.h | 2 +- deal.II/include/deal.II/lac/parallel_vector.h | 2 +- .../deal.II/lac/parallel_vector.templates.h | 8 +++---- deal.II/include/deal.II/lac/sparse_direct.h | 10 ++++----- .../include/deal.II/lac/swappable_vector.h | 2 +- .../deal.II/lac/swappable_vector.templates.h | 6 ++--- deal.II/include/deal.II/lac/vector_memory.h | 2 +- deal.II/source/dofs/dof_tools.cc | 4 ++-- deal.II/source/fe/fe_tools.cc | 10 ++++----- deal.II/source/fe/mapping_q_eulerian.cc | 2 +- deal.II/source/lac/sparse_direct.cc | 22 +++++++++---------- deal.II/source/lac/vector_memory.cc | 12 +++++----- deal.II/source/numerics/matrix_tools.cc | 20 ++++++++--------- 14 files changed, 52 insertions(+), 52 deletions(-) diff --git a/deal.II/include/deal.II/base/timer.h b/deal.II/include/deal.II/base/timer.h index 553445e70f..fed57a32bd 100644 --- a/deal.II/include/deal.II/base/timer.h +++ b/deal.II/include/deal.II/base/timer.h @@ -516,7 +516,7 @@ private: * class gives reasonable results even * when used with several threads. */ - Threads::ThreadMutex mutex; + Threads::Mutex mutex; }; diff --git a/deal.II/include/deal.II/fe/mapping_q_eulerian.h b/deal.II/include/deal.II/fe/mapping_q_eulerian.h index 54177ab37b..e748d1520c 100644 --- a/deal.II/include/deal.II/fe/mapping_q_eulerian.h +++ b/deal.II/include/deal.II/fe/mapping_q_eulerian.h @@ -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 diff --git a/deal.II/include/deal.II/lac/parallel_vector.h b/deal.II/include/deal.II/lac/parallel_vector.h index 69e2a7a33b..48d233401a 100644 --- a/deal.II/include/deal.II/lac/parallel_vector.h +++ b/deal.II/include/deal.II/lac/parallel_vector.h @@ -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 diff --git a/deal.II/include/deal.II/lac/parallel_vector.templates.h b/deal.II/include/deal.II/lac/parallel_vector.templates.h index d841e0a1f5..10b601f0cd 100644 --- a/deal.II/include/deal.II/lac/parallel_vector.templates.h +++ b/deal.II/include/deal.II/lac/parallel_vector.templates.h @@ -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(), diff --git a/deal.II/include/deal.II/lac/sparse_direct.h b/deal.II/include/deal.II/lac/sparse_direct.h index 03b3e1ce07..db7c679161 100644 --- a/deal.II/include/deal.II/lac/sparse_direct.h +++ b/deal.II/include/deal.II/lac/sparse_direct.h @@ -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 A 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 A array from the diff --git a/deal.II/include/deal.II/lac/swappable_vector.h b/deal.II/include/deal.II/lac/swappable_vector.h index 47464dd98e..02db61b625 100644 --- a/deal.II/include/deal.II/lac/swappable_vector.h +++ b/deal.II/include/deal.II/lac/swappable_vector.h @@ -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 diff --git a/deal.II/include/deal.II/lac/swappable_vector.templates.h b/deal.II/include/deal.II/lac/swappable_vector.templates.h index be74ebbb7b..215cd5a28a 100644 --- a/deal.II/include/deal.II/lac/swappable_vector.templates.h +++ b/deal.II/include/deal.II/lac/swappable_vector.templates.h @@ -66,7 +66,7 @@ SwappableVector::operator= (const SwappableVector &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::operator = (v); data_is_preloaded = false; @@ -94,7 +94,7 @@ void SwappableVector::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::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, diff --git a/deal.II/include/deal.II/lac/vector_memory.h b/deal.II/include/deal.II/lac/vector_memory.h index ec8926a42c..a5f35ac422 100644 --- a/deal.II/include/deal.II/lac/vector_memory.h +++ b/deal.II/include/deal.II/lac/vector_memory.h @@ -396,7 +396,7 @@ private: * internal data of this object * from multiple threads. */ - static Threads::ThreadMutex mutex; + static Threads::Mutex mutex; }; /*@}*/ diff --git a/deal.II/source/dofs/dof_tools.cc b/deal.II/source/dofs/dof_tools.cc index d3de9cdec0..783311e152 100644 --- a/deal.II/source/dofs/dof_tools.cc +++ b/deal.II/source/dofs/dof_tools.cc @@ -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; imutex); + 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; diff --git a/deal.II/source/lac/vector_memory.cc b/deal.II/source/lac/vector_memory.cc index b5019968f4..2e138a2644 100644 --- a/deal.II/source/lac/vector_memory.cc +++ b/deal.II/source/lac/vector_memory.cc @@ -31,7 +31,7 @@ template typename GrowingVectorMemory::Pool GrowingVectorMemory::pool; template -Threads::ThreadMutex GrowingVectorMemory::mutex; +Threads::Mutex GrowingVectorMemory::mutex; template inline @@ -96,7 +96,7 @@ GrowingVectorMemory::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::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::free(const VECTOR *const v) { - Threads::ThreadMutex::ScopedLock lock(mutex); + Threads::Mutex::ScopedLock lock(mutex); for (typename std::vector::iterator i=pool.data->begin(); i != pool.data->end(); ++i) { @@ -174,7 +174,7 @@ inline void GrowingVectorMemory::release_unused_memory () { - Threads::ThreadMutex::ScopedLock lock(mutex); + Threads::Mutex::ScopedLock lock(mutex); std::vector new_data; @@ -200,7 +200,7 @@ inline std::size_t GrowingVectorMemory::memory_consumption () const { - Threads::ThreadMutex::ScopedLock lock(mutex); + Threads::Mutex::ScopedLock lock(mutex); std::size_t result = sizeof (*this); const typename std::vector::const_iterator diff --git a/deal.II/source/numerics/matrix_tools.cc b/deal.II/source/numerics/matrix_tools.cc index 24bb447f41..7d97af1459 100644 --- a/deal.II/source/numerics/matrix_tools.cc +++ b/deal.II/source/numerics/matrix_tools.cc @@ -825,7 +825,7 @@ namespace MatrixCreator const Function *const coefficient, const std::vector &component_mapping, const MatrixCreator::internal::IteratorRange > 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 *const , const std::vector &, const MatrixCreator::internal::IteratorRange > , - Threads::ThreadMutex &) + Threads::Mutex &) { Assert(false,ExcNotImplemented()); } @@ -1112,7 +1112,7 @@ namespace MatrixCreator const Function<3> *const , const std::vector &, const MatrixCreator::internal::IteratorRange > , - 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 DoFHandler &, @@ -1193,7 +1193,7 @@ namespace MatrixCreator const Function *const coefficient, const std::vector &component_mapping, const MatrixCreator::internal::IteratorRange > range, - Threads::ThreadMutex &mutex); + Threads::Mutex &mutex); create_boundary_mass_matrix_1_t p = &create_boundary_mass_matrix_1; @@ -1225,7 +1225,7 @@ namespace MatrixCreator const Function *const coefficient, const std::vector &component_mapping, const MatrixCreator::internal::IteratorRange > range, - Threads::ThreadMutex &mutex) + Threads::Mutex &mutex) { const hp::MappingCollection &mapping = std_cxx1x::get<0>(commons); const hp::DoFHandler &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 *const coefficient, const std::vector &component_mapping, const MatrixCreator::internal::IteratorRange > range, - Threads::ThreadMutex &mutex); + Threads::Mutex &mutex); create_boundary_mass_matrix_1_t p = &create_boundary_mass_matrix_1; //TODO: Use WorkStream here -- 2.39.5