Index: trunk/MagicSoft/Cosy/base/MTimeout.cc
===================================================================
--- trunk/MagicSoft/Cosy/base/MTimeout.cc	(revision 2407)
+++ trunk/MagicSoft/Cosy/base/MTimeout.cc	(revision 2518)
@@ -1,1 +1,21 @@
 #include "MTimeout.h"
+
+#include <TSystem.h>
+
+MTimeout::MTimeout(unsigned long ms=500) : fTimeout((ULong_t)gSystem->Now()+ms)
+{
+    // Use SetTime to change the timing
+    // if (ms) TurnOn(); // Add to system list
+}
+
+bool MTimeout::HasTimedOut()
+{
+    return fTimeout<(ULong_t)gSystem->Now();
+}
+
+void MTimeout::Start(unsigned long ms=500)
+{
+    fTimeout = (ULong_t)gSystem->Now()+ms;
+    //Reset();  // reset before adding
+    //TurnOn(); // Add to system list
+}
Index: trunk/MagicSoft/Cosy/base/MTimeout.h
===================================================================
--- trunk/MagicSoft/Cosy/base/MTimeout.h	(revision 2407)
+++ trunk/MagicSoft/Cosy/base/MTimeout.h	(revision 2518)
@@ -1,9 +1,10 @@
-#ifndef MTIMEOUT_H
-#define MTIMEOUT_H
+#ifndef COSY_MTimeout
+#define COSY_MTimeout
 
-#include <TTimer.h>
+//#include <TTimer.h>
 
-class MTimeout : public TTimer
+class MTimeout// : public TTimer
 {
+    /*
     Bool_t Notify()
     {
@@ -11,17 +12,13 @@
         return kFALSE;
     }
+     */
+    unsigned long fTimeout;
 
 public:
-    MTimeout(Long_t ms=500) : TTimer(ms, kFALSE)
-    {
-        // Use SetTime to change the timing
-        if (ms) TurnOn(); // Add to system list
-    }
+    MTimeout(unsigned long ms=500);
 
-    void Start()
-    {
-        Reset();  // reset before adding
-        TurnOn(); // Add to system list
-    }
+    bool HasTimedOut();
+
+    void Start(unsigned long ms=500);
 };
 
Index: trunk/MagicSoft/Cosy/base/msgqueue.cc
===================================================================
--- trunk/MagicSoft/Cosy/base/msgqueue.cc	(revision 2407)
+++ trunk/MagicSoft/Cosy/base/msgqueue.cc	(revision 2518)
@@ -89,7 +89,7 @@
         // a PostMsg is processed correctly
         //
-        pthread_mutex_lock(&fMuxMsg);
+        fMuxMsg.Lock();
         fBreak = 0;
-        pthread_mutex_unlock(&fMuxMsg);
+        fMuxMsg.UnLock();
 
 #ifdef DEBUG
@@ -130,5 +130,5 @@
     cout << "MsgQueue::PostMsg: Locking MsgQueue mutex..." << flush;
 #endif
-    pthread_mutex_lock(&fMuxMsg);
+    fMuxMsg.Lock();
 #ifdef DEBUG
     cout << "done." << endl;
@@ -145,5 +145,5 @@
     if (fBreak)
     {
-        pthread_mutex_unlock(&fMuxMsg);
+        fMuxMsg.UnLock();
 #ifdef DEBUG
         cout << "------------> MsgQueue::PostMsg: Proc still pending... Message IGNORED." << endl;
@@ -176,5 +176,5 @@
 #endif
     fStart = 1;
-    pthread_mutex_unlock(&fMuxMsg);
+    fMuxMsg.UnLock();
 #ifdef DEBUG
     cout << "done." << endl;
Index: trunk/MagicSoft/Cosy/base/msgqueue.h
===================================================================
--- trunk/MagicSoft/Cosy/base/msgqueue.h	(revision 2407)
+++ trunk/MagicSoft/Cosy/base/msgqueue.h	(revision 2518)
@@ -6,4 +6,8 @@
 #define WM_NULL 0x0000
 #define WM_QUIT 0xffff
+
+#ifndef ROOT_TMutex
+#include <TMutex.h>
+#endif
 
 class MsgQueue
@@ -19,9 +23,6 @@
     void *fRc;    // Proc return code
 
-    pthread_t       fThread;
-    pthread_mutex_t fMuxMsg;
-    pthread_cond_t  fCondMsg;
-    pthread_mutex_t fMuxRc;
-    pthread_cond_t  fCondRc;
+    pthread_t fThread;
+    TMutex    fMuxMsg;
 
     static void *MapThread(void *arg);
@@ -36,6 +37,8 @@
 
     virtual void *Proc(int msg, void *mp1);
+    void *Proc(int msg) { return Proc(msg, 0); }
 
     void *PostMsg(int msg, void *mp1, int size);
+    void *PostMsg(int msg) { return PostMsg(msg, 0, 0); }
 };
 
Index: trunk/MagicSoft/Cosy/base/timer.cc
===================================================================
--- trunk/MagicSoft/Cosy/base/timer.cc	(revision 2407)
+++ trunk/MagicSoft/Cosy/base/timer.cc	(revision 2518)
@@ -136,5 +136,5 @@
 const char *Timer::GetTimeStr()
 {
-    sprintf(fDateStr, "%d/%02d/%02d %d:%02d:%02d.%06li",
+    sprintf(fDateStr, "%2d/%02d/%02d %d:%02d:%02d.%06li",
             fYea, fMon, fDay, fHor, fMin, fSec, (long)(1000000.0*fMs));
 
@@ -146,5 +146,5 @@
     char text[256];
 
-    sprintf(text, "%d/%02d/%02d %d:%02d:%02d.%01li",
+    sprintf(text, "%2d/%02d/%02d %d:%02d:%02d.%01li",
             t.fYea, t.fMon, t.fDay, t.fHor, t.fMin, t.fSec, (long)(10.0*t.fMs));
 
