Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 2518)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 2519)
@@ -3,5 +3,22 @@
 
                                                  -*-*- END OF LINE -*-*-
+ 2003/11/17: Thomas Bretz
+ 
+   * mbase/MLog.cc:
+     - replaced pthread_mutex by a TMutex
+     - renamed fgui to fGui
+     - renamed fout to fOut
+     
+   * mbase/MStatusDisplay.cc:
+     - removed ==13 using TryLock() (this was wrong)
+
+
+
  2003/11/15: Thomas Bretz, Abelardo Moralejo
+
+   REMARK: These changes are preliminary! I want to implement a
+           more straight forward solution piping fSerialNumber
+           when calling SetupFill(). Don't relay on the current
+           code!
 
    * mhist/MH.h: 
@@ -19,4 +36,6 @@
    * NEWS: 
      - updated.
+
+
 
  2003/11/14: Abelardo Moralejo
@@ -28,4 +47,6 @@
        The change consists in the addittion in MF::IsAlNum of ';' as 
        a possible alphanumeric character in the string.
+
+
 
  2003/11/13: Thomas Bretz
Index: /trunk/MagicSoft/Mars/NEWS
===================================================================
--- /trunk/MagicSoft/Mars/NEWS	(revision 2518)
+++ /trunk/MagicSoft/Mars/NEWS	(revision 2519)
@@ -5,4 +5,6 @@
      multi-telescope files which can be produced with the coming
      camera version 0.7.
+
+
 
  *** Version 0.8.2 (2003/11/10)
Index: /trunk/MagicSoft/Mars/mbase/MLog.cc
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MLog.cc	(revision 2518)
+++ /trunk/MagicSoft/Mars/mbase/MLog.cc	(revision 2519)
@@ -101,6 +101,5 @@
 
 #ifdef _REENTRANT
-// FIXME: Replace Mutex by TMutex
-#include <pthread.h>
+#include <TMutex.h>
 #endif
 #include <TGTextView.h>
@@ -148,6 +147,5 @@
     // Creat drawing semaphore
     //
-    fMuxGui = new pthread_mutex_t;
-    pthread_mutex_init((pthread_mutex_t*)fMuxGui, NULL);
+    fMuxGui = new TMutex;
 #endif
 }
@@ -158,5 +156,5 @@
 // which is used for the output (i)
 //
-MLog::MLog(int i) : ostream(this), fPPtr(fBase), fEPtr(fBase+bsz), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(i), fIsNull(kFALSE), fout(NULL), fOutAllocated(kFALSE), fgui(NULL), fNumLines(0)
+MLog::MLog(int i) : ostream(this), fPPtr(fBase), fEPtr(fBase+bsz), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(i), fIsNull(kFALSE), fOut(NULL), fOutAllocated(kFALSE), fGui(NULL), fNumLines(0)
 {
     Init();
@@ -168,5 +166,5 @@
 // ofstream as the default output device
 //
-MLog::MLog(ofstream &out) : ostream(this), fPPtr(fBase), fEPtr(fBase+bsz), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(eFile), fIsNull(kFALSE), fout(&out), fOutAllocated(kFALSE), fgui(NULL), fNumLines(0)
+MLog::MLog(ofstream &out) : ostream(this), fPPtr(fBase), fEPtr(fBase+bsz), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(eFile), fIsNull(kFALSE), fOut(&out), fOutAllocated(kFALSE), fGui(NULL), fNumLines(0)
 {
     Init();
@@ -178,5 +176,5 @@
 // TGTextView as the default output device
 //
-MLog::MLog(TGTextView &out) : ostream(this), fPPtr(fBase), fEPtr(fBase+bsz), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(eGui), fout(NULL), fOutAllocated(kFALSE), fgui(&out), fNumLines(0)
+MLog::MLog(TGTextView &out) : ostream(this), fPPtr(fBase), fEPtr(fBase+bsz), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(eGui), fOut(NULL), fOutAllocated(kFALSE), fGui(&out), fNumLines(0)
 {
     Init();
@@ -189,5 +187,5 @@
 // or not.
 //
-MLog::MLog(const char *fname, int flag) : ostream(this), fPPtr(fBase), fEPtr(fBase+bsz), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(eFile), fIsNull(kFALSE), fgui(NULL), fNumLines(0)
+MLog::MLog(const char *fname, int flag) : ostream(this), fPPtr(fBase), fEPtr(fBase+bsz), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(eFile), fIsNull(kFALSE), fGui(NULL), fNumLines(0)
 {
     Init();
@@ -205,5 +203,5 @@
     DeallocateFile();
 #ifdef _REENTRANT
-    pthread_mutex_destroy((pthread_mutex_t*)fMuxGui);
+    delete fMuxGui;
 #endif
 }
@@ -310,8 +308,8 @@
         Output(cerr, len);
 
-    if (fDevice&eFile && fout)
-        fout->write(fBase, len);
-
-    if (fDevice&eGui && fgui)
+    if (fDevice&eFile && fOut)
+        fOut->write(fBase, len);
+
+    if (fDevice&eGui && fGui)
     {
         // check whether the current text was flushed or endl'ed
@@ -348,5 +346,5 @@
     Lock();
 
-    TGText &txt=*fgui->GetText();
+    TGText &txt=*fGui->GetText();
 
     // copy lines to TGListBox
@@ -367,9 +365,9 @@
 
     // show last entry
-    fgui->Layout();
-    fgui->SetVsbPosition(txt.RowCount()-1);
+    fGui->Layout();
+    fGui->SetVsbPosition(txt.RowCount()-1);
 
     // tell a main loop, that list box contents have changed
-    fgui->SetBit(kHasChanged);
+    fGui->SetBit(kHasChanged);
 
     // release mutex
@@ -380,5 +378,5 @@
 {
 #ifdef _REENTRANT
-    pthread_mutex_lock((pthread_mutex_t*)fMuxGui);
+    fMuxGui->Lock();
 #endif
 }
@@ -387,5 +385,5 @@
 {
 #ifdef _REENTRANT
-    pthread_mutex_unlock((pthread_mutex_t*)fMuxGui);
+    fMuxGui->UnLock();
 #endif
 }
@@ -411,6 +409,6 @@
         cerr.flush();
 
-    if (fDevice&eFile && fout)
-        fout->flush();
+    if (fDevice&eFile && fOut)
+        fOut->flush();
 
     return 0;
@@ -455,5 +453,5 @@
     // gcc 3.2:
     char *txt = (char*)"logXXXXXX";
-    fout = fname ? new ofstream(fname) : new ofstream(/*mkstemp(*/txt/*)*/);
+    fOut = fname ? new ofstream(fname) : new ofstream(/*mkstemp(*/txt/*)*/);
     fOutAllocated = kTRUE;
 }
@@ -467,5 +465,5 @@
 {
     if (fOutAllocated)
-        delete fout;
+        delete fOut;
 }
 
Index: /trunk/MagicSoft/Mars/mbase/MLog.h
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MLog.h	(revision 2518)
+++ /trunk/MagicSoft/Mars/mbase/MLog.h	(revision 2519)
@@ -13,4 +13,5 @@
 #define bsz    160 // two standard lines
 
+class TMutex;
 class TGTextView;
 
@@ -57,7 +58,7 @@
     Bool_t fIsNull;           //! Switch output completely off
 
-    ofstream   *fout;          //! possible file output stream
+    ofstream   *fOut;          //! possible file output stream
     Bool_t      fOutAllocated; //! flag if fout is created by MLogging
-    TGTextView *fgui;          //! Text View output
+    TGTextView *fGui;          //! Text View output
 
     Bool_t     fIsDirectGui;  //! Pipe text directly to the GUI (for single threaded environments)
@@ -67,5 +68,5 @@
 
 #ifdef _REENTRANT
-    void *fMuxGui;            //! Mutex locking access of TGListBox
+    TMutex *fMuxGui;          //! Mutex locking access of TGListBox
 #endif
 
@@ -119,5 +120,5 @@
     void SetOutputGui(TGTextView *out, int flag=-1)
     {
-        fgui = out;
+        fGui = out;
         CheckFlag(eGui, flag);
     }
@@ -133,5 +134,5 @@
         //
         DeallocateFile();
-        fout = &out;
+        fOut = &out;
         CheckFlag(eFile, flag);
     }
@@ -162,7 +163,7 @@
         // I would implement a GetFileName-function, too.
         //
-        if (!fout)
+        if (!fOut)
             ReallocateFile(NULL);
-        return *fout;
+        return *fOut;
     }
 
Index: /trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc	(revision 2518)
+++ /trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc	(revision 2519)
@@ -894,5 +894,5 @@
     // in the same thread
     //
-    if (fMutex->TryLock()==13)
+    if (fMutex->TryLock())
         return;
 
