From: Wolfgang Bangerth Date: Tue, 24 Oct 2023 21:12:22 +0000 (-0600) Subject: Move a variable to the .cc file. X-Git-Tag: relicensing~298^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F16185%2Fhead;p=dealii.git Move a variable to the .cc file. --- diff --git a/include/deal.II/fe/fe_tools.templates.h b/include/deal.II/fe/fe_tools.templates.h index 82469926cd..5125e160d3 100644 --- a/include/deal.II/fe/fe_tools.templates.h +++ b/include/deal.II/fe/fe_tools.templates.h @@ -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 diff --git a/source/fe/fe_tools.cc b/source/fe/fe_tools.cc index 5b543875ad..8c8638dfe6 100644 --- a/source/fe/fe_tools.cc +++ b/source/fe/fe_tools.cc @@ -18,6 +18,19 @@ 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"