From: wolf Date: Tue, 1 Oct 2002 17:17:52 +0000 (+0000) Subject: Make sure only one thread writes at a time. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9637d2f615858016feb6bf4253cdd1a698b99c3;p=dealii-svn.git Make sure only one thread writes at a time. git-svn-id: https://svn.dealii.org/trunk@6582 0785d39b-7218-0410-832d-ea1e28bc413d --- 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 (); }; };