Index: trunk/MagicSoft/Mars/mbase/MLog.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MLog.cc	(revision 3944)
+++ trunk/MagicSoft/Mars/mbase/MLog.cc	(revision 3957)
@@ -149,5 +149,6 @@
     //
 #ifdef _REENTRANT
-    fMuxGui = new TMutex;
+    fMuxGui    = new TMutex;
+    fMuxStream = new TMutex;
 #endif
 
@@ -213,4 +214,5 @@
     delete fPlugins;
 #ifdef _REENTRANT
+    delete fMuxStream;
     delete fMuxGui;
 #endif
@@ -359,5 +361,5 @@
 
     // lock mutex
-    Lock("UpdateGui");
+    LockUpdate("UpdateGui");
 
     TGText &txt=*fGui->GetText();
@@ -387,5 +389,21 @@
 
     // release mutex
-    UnLock("UpdateGui");
+    UnLockUpdate("UpdateGui");
+}
+
+void MLog::LockUpdate(const char *msg)
+{
+#ifdef _REENTRANT
+    if (fMuxGui->Lock()==13)
+        Error("LockUpdate", "%s - mutex is already locked by this thread\n", msg);
+#endif
+}
+
+void MLog::UnLockUpdate(const char *msg)
+{
+#ifdef _REENTRANT
+    if (fMuxGui->UnLock()==13)
+        Error("UnLockUpdate", "%s - tried to unlock mutex locked by other thread\n", msg);
+#endif
 }
 
@@ -393,5 +411,5 @@
 {
 #ifdef _REENTRANT
-    if (fMuxGui->Lock()==13)
+    if (fMuxStream->Lock()==13)
         Error("Lock", "%s - mutex is already locked by this thread\n", msg);
 #endif
@@ -401,5 +419,5 @@
 {
 #ifdef _REENTRANT
-    if (fMuxGui->UnLock()==13)
+    if (fMuxStream->UnLock()==13)
         Error("UnLock", "%s - tried to unlock mutex locked by other thread\n", msg);
 #endif
@@ -412,7 +430,7 @@
 int MLog::sync()
 {
-    Lock("sync");
+    LockUpdate("sync");
     WriteBuffer();
-    UnLock("sync");
+    UnLockUpdate("sync");
 
     if (fDevice&eStdout)
@@ -448,5 +466,5 @@
     if (fOutputLevel <= fDebugLevel)
     {
-        Lock("overflow");
+        LockUpdate("overflow");
 
         *fPPtr++ = (char)i;
@@ -455,5 +473,5 @@
             WriteBuffer();
 
-        UnLock("overflow");
+        UnLockUpdate("overflow");
     }
 
Index: trunk/MagicSoft/Mars/mbase/MLog.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MLog.h	(revision 3944)
+++ trunk/MagicSoft/Mars/mbase/MLog.h	(revision 3957)
@@ -71,4 +71,5 @@
 #ifdef _REENTRANT
     TMutex *fMuxGui;          //! Mutex locking access of TGListBox
+    TMutex *fMuxStream;       //! Mutex locking access to streaming
 #endif
 
@@ -102,6 +103,9 @@
     ~MLog();
 
-    void Lock(const char *msg);
-    void UnLock(const char *msg);
+    void LockUpdate(const char *msg);
+    void UnLockUpdate(const char *msg);
+
+    void Lock(const char *msg="");
+    void UnLock(const char *msg="");
 
     void EnableDirectGui()  { fIsDirectGui = kTRUE; }
