From: Jean-Paul Pelteret Date: Sat, 28 Jul 2018 17:50:26 +0000 (+0200) Subject: Fix position of a lock guard X-Git-Tag: v9.1.0-rc1~873^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0e9ab99e1ac5c38d7ade00f7d9f9be6dd7d705f8;p=dealii.git Fix position of a lock guard --- 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);