From: Wolfgang Bangerth Date: Thu, 27 Sep 2018 13:55:24 +0000 (-0600) Subject: Use std::mutex functions instead of the names in Threads::Mutex. X-Git-Tag: v9.1.0-rc1~679^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=79acdc7b21ef6408c15ff5b1fcd4381c7daefda8;p=dealii.git Use std::mutex functions instead of the names in Threads::Mutex. --- diff --git a/include/deal.II/lac/swappable_vector.templates.h b/include/deal.II/lac/swappable_vector.templates.h index 5b109df84a..133edcdb73 100644 --- a/include/deal.II/lac/swappable_vector.templates.h +++ b/include/deal.II/lac/swappable_vector.templates.h @@ -131,7 +131,7 @@ SwappableVector::reload() // possibly existing @p alert // calls. if not in MT mode, this // is a no-op - lock.acquire(); + lock.lock(); // if data was already preloaded, // then there is no more need to @@ -150,8 +150,8 @@ SwappableVector::reload() // release lock. the lock is // also released in the other // branch of the if-clause - lock.release(); - }; + lock.unlock(); + } } @@ -169,7 +169,7 @@ SwappableVector::alert() // synchronize with possible other // invocations of this function and // other functions in this class - lock.acquire(); + lock.lock(); // calling this function multiple // times does no harm: @@ -178,7 +178,7 @@ SwappableVector::alert() // vector is active does no harm // either (this->size() != 0)) - lock.release(); + lock.unlock(); else // data has not been preloaded so // far, so go on! For this, start @@ -210,7 +210,7 @@ SwappableVector::reload_vector(const bool set_flag) // set the flag if so required if (set_flag) data_is_preloaded = true; - lock.release(); + lock.unlock(); #endif } diff --git a/source/base/polynomial.cc b/source/base/polynomial.cc index eca63433ca..f02f1a1608 100644 --- a/source/base/polynomial.cc +++ b/source/base/polynomial.cc @@ -1066,9 +1066,9 @@ namespace Polynomials } else if (k == 2) { - coefficients_lock.release(); + coefficients_lock.unlock(); compute_coefficients(1); - coefficients_lock.acquire(); + coefficients_lock.lock(); std::vector c2(3); @@ -1091,9 +1091,9 @@ namespace Polynomials // allow the called // function to acquire it // itself - coefficients_lock.release(); + coefficients_lock.unlock(); compute_coefficients(k - 1); - coefficients_lock.acquire(); + coefficients_lock.lock(); std::vector ck(k + 1);