From c9637d2f615858016feb6bf4253cdd1a698b99c3 Mon Sep 17 00:00:00 2001 From: wolf Date: Tue, 1 Oct 2002 17:17:52 +0000 Subject: [PATCH] Make sure only one thread writes at a time. git-svn-id: https://svn.dealii.org/trunk@6582 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/lac/source/sparse_direct.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/deal.II/lac/source/sparse_direct.cc b/deal.II/lac/source/sparse_direct.cc index df87a9e76d..8c3f5ef2e9 100644 --- a/deal.II/lac/source/sparse_direct.cc +++ b/deal.II/lac/source/sparse_direct.cc @@ -243,6 +243,11 @@ namespace CommunicationsLog void list_communication () { + // make sure only one thread is + // writing out at a time + static Threads::ThreadMutex write_lock; + write_lock.acquire (); + std::cerr << "++++++++++++++++++++++++++++++" << std::endl << "Communiction log history:" << std::endl; @@ -259,6 +264,8 @@ namespace CommunicationsLog << i->description << std::endl; std::cerr << "++++++++++++++++++++++++++++++" << std::endl; + + write_lock.release (); }; }; -- 2.39.5