From: kanschat Date: Sun, 4 Dec 2011 23:16:29 +0000 (+0000) Subject: add function to modify float threshold and make test_mode() thread safe X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6933c3fcea68726a44be755ff68402bd39b08ad3;p=dealii-svn.git add function to modify float threshold and make test_mode() thread safe git-svn-id: https://svn.dealii.org/trunk@24790 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/include/deal.II/base/logstream.h b/deal.II/include/deal.II/base/logstream.h index 5023e59d03..ae631d08b7 100644 --- a/deal.II/include/deal.II/base/logstream.h +++ b/deal.II/include/deal.II/base/logstream.h @@ -293,6 +293,12 @@ class LogStream * this case. */ void threshold_double(const double t); + /** + * The same as + * threshold_double(), but for + * float values. + */ + void threshold_float(const float t); /** * Output a constant something diff --git a/deal.II/source/base/logstream.cc b/deal.II/source/base/logstream.cc index e853162167..f5a3728a96 100644 --- a/deal.II/source/base/logstream.cc +++ b/deal.II/source/base/logstream.cc @@ -111,6 +111,7 @@ LogStream::~LogStream() void LogStream::test_mode(bool on) { + Threads::ThreadMutex::ScopedLock lock(log_lock); if (on) { double_threshold = 1.e-10; @@ -279,6 +280,14 @@ LogStream::threshold_double (const double t) } +void +LogStream::threshold_float (const float t) +{ + Threads::ThreadMutex::ScopedLock lock(log_lock); + float_threshold = t; +} + + bool LogStream::log_execution_time (const bool flag) {