]> https://gitweb.dealii.org/ - dealii.git/commitdiff
add mutex lock 7375/head
authorDenis Davydov <davydden@gmail.com>
Tue, 30 Oct 2018 15:52:48 +0000 (16:52 +0100)
committerDenis Davydov <davydden@gmail.com>
Tue, 30 Oct 2018 16:10:26 +0000 (17:10 +0100)
source/base/incremental_function.cc

index 49bde1148c43165d6d59a91414343d4512ff1966..18091c358da37f6721c89aa22ff953d0735af4d7 100644 (file)
@@ -50,6 +50,10 @@ namespace Functions
     const Point<dim> & p,
     const unsigned int comp) const
   {
+    // since we modify a mutable member variable, lock the
+    // the data via a mutex
+    std::lock_guard<std::mutex> lock(mutex);
+
     // Cache the time state of the base class in case it has been changed
     // within the user code. We reset the wrapped function to the original
     // state once we're done with our own evaluations.

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.