From 6933c3fcea68726a44be755ff68402bd39b08ad3 Mon Sep 17 00:00:00 2001 From: kanschat Date: Sun, 4 Dec 2011 23:16:29 +0000 Subject: [PATCH] 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 --- deal.II/include/deal.II/base/logstream.h | 6 ++++++ deal.II/source/base/logstream.cc | 9 +++++++++ 2 files changed, 15 insertions(+) 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) { -- 2.39.5