From 2d6f3dce8dd212ad1b64490fa1f1145f11de42cf Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Mon, 23 Oct 2023 06:49:29 -0600 Subject: [PATCH] Split a mutex into two, give them better names. --- include/deal.II/fe/fe_system.h | 6 ++++-- source/fe/fe_system.cc | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/include/deal.II/fe/fe_system.h b/include/deal.II/fe/fe_system.h index 7abb98633f..c3cb16fa4a 100644 --- a/include/deal.II/fe/fe_system.h +++ b/include/deal.II/fe/fe_system.h @@ -1332,9 +1332,11 @@ private: }; /** - * Mutex for protecting initialization of restriction and embedding matrix. + * Mutex variables used for protecting the initialization of restriction + * and embedding matrices. */ - mutable std::mutex mutex; + mutable std::mutex restriction_matrix_mutex; + mutable std::mutex prolongation_matrix_mutex; friend class FE_Enriched; }; diff --git a/source/fe/fe_system.cc b/source/fe/fe_system.cc index 5759b45936..ecfc46d598 100644 --- a/source/fe/fe_system.cc +++ b/source/fe/fe_system.cc @@ -898,7 +898,7 @@ FESystem::get_restriction_matrix( // initialization upon first request if (this->restriction[refinement_case - 1][child].n() == 0) { - std::lock_guard lock(this->mutex); + std::lock_guard lock(restriction_matrix_mutex); // check if updated while waiting for lock if (this->restriction[refinement_case - 1][child].n() == @@ -990,7 +990,7 @@ FESystem::get_prolongation_matrix( // restriction matrix if (this->prolongation[refinement_case - 1][child].n() == 0) { - std::lock_guard lock(this->mutex); + std::lock_guard lock(prolongation_matrix_mutex); if (this->prolongation[refinement_case - 1][child].n() == this->n_dofs_per_cell()) -- 2.39.5