]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Move a variable to the .cc file. 16185/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Tue, 24 Oct 2023 21:12:22 +0000 (15:12 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Tue, 24 Oct 2023 21:12:22 +0000 (15:12 -0600)
include/deal.II/fe/fe_tools.templates.h
source/fe/fe_tools.cc

index 82469926cd988f7aaf792b71296720330be58913..5125e160d31b591ba397f8e86e7245d732b65a8d 100644 (file)
@@ -1220,15 +1220,12 @@ namespace FETools
       }
 
 
-      // have a lock that guarantees that at most one thread is changing
-      // and accessing the fe_name_map variable. make this lock local to
-      // this file.
-      //
-      // This variable is declared static (even though
-      // it belongs to an internal namespace) in order to make icc happy
-      // (which otherwise reports a multiply defined symbol when linking
-      // libraries for more than one space dimension together)
-      static std::shared_mutex fe_name_map_lock;
+      // Have a lock that guarantees that at most one thread is changing
+      // and accessing the fe_name_map variable. The variable
+      // is declared 'extern' here because we are in a .h file, but
+      // it really needs to be defined in a .cc file (and indeed we have
+      // the definition there).
+      extern std::shared_mutex fe_name_map_lock;
 
       // This is the map used by FETools::get_fe_by_name and
       // FETools::add_fe_name. It is only accessed by functions in this
index 5b543875ad29eba64f18451b8bb336734705d099..8c8638dfe617059b326676687ad23ae930ed6786 100644 (file)
 
 DEAL_II_NAMESPACE_OPEN
 
+
+namespace FETools
+{
+  namespace internal
+  {
+    namespace FEToolsAddFENameHelper
+    {
+      std::shared_mutex fe_name_map_lock;
+    }
+  } // namespace internal
+} // namespace FETools
+
+
 /*-------------- Explicit Instantiations -------------------------------*/
 #include "fe_tools.inst"
 

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.