]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Make sure only one thread writes at a time.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 1 Oct 2002 17:17:52 +0000 (17:17 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 1 Oct 2002 17:17:52 +0000 (17:17 +0000)
git-svn-id: https://svn.dealii.org/trunk@6582 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/source/sparse_direct.cc

index df87a9e76dc61f44520130117cf1eba710e79384..8c3f5ef2e9c07bfa0ab185778d258a5a371cbe32 100644 (file)
@@ -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 ();
   };  
 };
 

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.