From 0e9ab99e1ac5c38d7ade00f7d9f9be6dd7d705f8 Mon Sep 17 00:00:00 2001 From: Jean-Paul Pelteret Date: Sat, 28 Jul 2018 19:50:26 +0200 Subject: [PATCH] Fix position of a lock guard --- source/base/subscriptor.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/base/subscriptor.cc b/source/base/subscriptor.cc index a02237ee48..6da08803df 100644 --- a/source/base/subscriptor.cc +++ b/source/base/subscriptor.cc @@ -156,14 +156,14 @@ Subscriptor::operator=(Subscriptor &&s) noexcept void Subscriptor::subscribe(const char *id) const { - if (object_info == nullptr) - object_info = &typeid(*this); - ++counter; - #ifdef DEAL_II_WITH_THREADS std::lock_guard lock(mutex); #endif + if (object_info == nullptr) + object_info = &typeid(*this); + ++counter; + const char *const name = (id != 0) ? id : unknown_subscriber; map_iterator it = counter_map.find(name); -- 2.39.5