]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Split a mutex into two, give them better names. 16174/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Mon, 23 Oct 2023 12:49:29 +0000 (06:49 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Mon, 23 Oct 2023 17:15:00 +0000 (11:15 -0600)
include/deal.II/fe/fe_system.h
source/fe/fe_system.cc

index 7abb98633f8c72c42a427032c27dd4fd37dd0282..c3cb16fa4a01364ab21a9340ec82ffcb523f740e 100644 (file)
@@ -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<dim, spacedim>;
 };
index 5759b45936d52708144cad53a0a448564bdfb7ef..ecfc46d5982ddb7505ce90b919737f4a82ab6e75 100644 (file)
@@ -898,7 +898,7 @@ FESystem<dim, spacedim>::get_restriction_matrix(
   // initialization upon first request
   if (this->restriction[refinement_case - 1][child].n() == 0)
     {
-      std::lock_guard<std::mutex> lock(this->mutex);
+      std::lock_guard<std::mutex> lock(restriction_matrix_mutex);
 
       // check if updated while waiting for lock
       if (this->restriction[refinement_case - 1][child].n() ==
@@ -990,7 +990,7 @@ FESystem<dim, spacedim>::get_prolongation_matrix(
   // restriction matrix
   if (this->prolongation[refinement_case - 1][child].n() == 0)
     {
-      std::lock_guard<std::mutex> lock(this->mutex);
+      std::lock_guard<std::mutex> lock(prolongation_matrix_mutex);
 
       if (this->prolongation[refinement_case - 1][child].n() ==
           this->n_dofs_per_cell())

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.