From 676c6347576a8435d20f08bd6f2a96fc820241d9 Mon Sep 17 00:00:00 2001 From: maier Date: Tue, 23 Apr 2013 08:00:19 +0000 Subject: [PATCH] Add the log_lock mutex to the three new method in LogStream that modify the stream This ensures consistency of the simultaneous get and set procedure. git-svn-id: https://svn.dealii.org/trunk@29364 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/source/base/logstream.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/deal.II/source/base/logstream.cc b/deal.II/source/base/logstream.cc index e0f7893465..7594dc2750 100644 --- a/deal.II/source/base/logstream.cc +++ b/deal.II/source/base/logstream.cc @@ -260,6 +260,8 @@ void LogStream::pop () std::ios::fmtflags LogStream::flags(const std::ios::fmtflags f) { + Threads::Mutex::ScopedLock lock(log_lock); + std::ios::fmtflags tmp = stream_flags; stream_flags = f; return tmp; @@ -269,6 +271,8 @@ LogStream::flags(const std::ios::fmtflags f) std::streamsize LogStream::precision (const std::streamsize prec) { + Threads::Mutex::ScopedLock lock(log_lock); + std::streamsize tmp = stream_precision; stream_precision = prec; return tmp; @@ -278,6 +282,8 @@ LogStream::precision (const std::streamsize prec) std::streamsize LogStream::width (const std::streamsize wide) { + Threads::Mutex::ScopedLock lock(log_lock); + std::streamsize tmp = stream_width; stream_width = wide; return tmp; -- 2.39.5