From d377e9e7416ebd80ff0fae2b62ca9f5ae7358643 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Sat, 29 Sep 2018 08:07:43 +0200 Subject: [PATCH] More fixes --- include/deal.II/base/subscriptor.h | 11 +---------- source/base/subscriptor.cc | 6 ------ 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/include/deal.II/base/subscriptor.h b/include/deal.II/base/subscriptor.h index 9a44a0dae2..d1dbc9d074 100644 --- a/include/deal.II/base/subscriptor.h +++ b/include/deal.II/base/subscriptor.h @@ -23,13 +23,10 @@ #include #include +#include #include #include -#ifdef DEAL_II_WITH_THREADS -# include -#endif - DEAL_II_NAMESPACE_OPEN /** @@ -250,15 +247,11 @@ private: void check_no_subscribers() const noexcept; -#ifdef DEAL_II_WITH_THREADS - /** * A mutex used to ensure data consistency when printing out the list * of subscribers. */ static std::mutex mutex; - -#endif }; //--------------------------------------------------------------------------- @@ -275,9 +268,7 @@ template inline void Subscriptor::list_subscribers(StreamType &stream) const { -#ifdef DEAL_II_WITH_THREADS std::lock_guard lock(mutex); -#endif for (map_iterator it = counter_map.begin(); it != counter_map.end(); ++it) stream << it->second << '/' << counter << " subscriptions from \"" diff --git a/source/base/subscriptor.cc b/source/base/subscriptor.cc index 57d0615c70..5cef19f1b0 100644 --- a/source/base/subscriptor.cc +++ b/source/base/subscriptor.cc @@ -27,9 +27,7 @@ DEAL_II_NAMESPACE_OPEN static const char *unknown_subscriber = "unknown subscriber"; -#ifdef DEAL_II_WITH_THREADS std::mutex Subscriptor::mutex; -#endif Subscriptor::Subscriptor() @@ -156,9 +154,7 @@ Subscriptor::operator=(Subscriptor &&s) noexcept void Subscriptor::subscribe(const char *id) const { -#ifdef DEAL_II_WITH_THREADS std::lock_guard lock(mutex); -#endif if (object_info == nullptr) object_info = &typeid(*this); @@ -185,9 +181,7 @@ Subscriptor::unsubscribe(const char *id) const if (counter == 0) return; -#ifdef DEAL_II_WITH_THREADS std::lock_guard lock(mutex); -#endif map_iterator it = counter_map.find(name); if (it == counter_map.end() || it->second == 0) -- 2.39.5