]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
add function to modify float threshold and make test_mode() thread safe
authorkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 4 Dec 2011 23:16:29 +0000 (23:16 +0000)
committerkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 4 Dec 2011 23:16:29 +0000 (23:16 +0000)
git-svn-id: https://svn.dealii.org/trunk@24790 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/base/logstream.h
deal.II/source/base/logstream.cc

index 5023e59d03a82ff2bce0710ed5daa5b339214646..ae631d08b79909ae8d950706b3d6e2a90ed0d9ee 100644 (file)
@@ -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
index e853162167210d4fe7a85ab824d866b7a40a6c17..f5a3728a96d690b8064a950ff20fa564999ec0fc 100644 (file)
@@ -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)
 {

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.