]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix position of a lock guard 6328/head
authorJean-Paul Pelteret <jppelteret@gmail.com>
Sat, 28 Jul 2018 17:50:26 +0000 (19:50 +0200)
committerJean-Paul Pelteret <jppelteret@gmail.com>
Sat, 28 Jul 2018 17:50:47 +0000 (19:50 +0200)
source/base/subscriptor.cc

index a02237ee484db6d564baaa3788604821a3d5b9ac..6da08803dfbf3638364b0c127202ac6a7279e13e 100644 (file)
@@ -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<std::mutex> 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);

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.