From: Daniel Arndt Date: Sat, 29 Sep 2018 06:07:43 +0000 (+0200) Subject: More fixes X-Git-Tag: v9.1.0-rc1~668^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d377e9e7416ebd80ff0fae2b62ca9f5ae7358643;p=dealii.git More fixes --- 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)