Index: /trunk/MagicSoft/Cosy/Changelog
===================================================================
--- /trunk/MagicSoft/Cosy/Changelog	(revision 8842)
+++ /trunk/MagicSoft/Cosy/Changelog	(revision 8843)
@@ -1,3 +1,15 @@
                                                                   -*-*- END -*-*-
+
+ 2008/01/31 Thomas Bretz
+
+   * base/Makefile:
+     - removed MThread... now in Mars
+
+   * base/msgqueue.[h,cc], candrv/nodedrv.cc, candrv/vmodican.h,
+     main/MCosy.h, main/MTracking.h, tcpip/MTcpIpIO.[h,cc],
+     videodev/Camera.[h,cc]:
+     - renamed MyThreadX to MThread
+
+
 
  2008/01/30 Thomas Bretz
Index: unk/MagicSoft/Cosy/base/MThread.cc
===================================================================
--- /trunk/MagicSoft/Cosy/base/MThread.cc	(revision 8842)
+++ 	(revision )
@@ -1,27 +1,0 @@
-#include <MThread.h>
-
-using namespace std;
-
-TString MyThreadX::GetThreadStateStr() const
-{
-    switch (fThread.GetState())
-    {
-    case TThread::kInvalidState:
-        return "Invalid - thread was not created properly";
-    case TThread::kNewState:
-        return "New - thread object exists but hasn't started";
-    case TThread::kRunningState:
-        return "Running - thread is running";
-    case TThread::kTerminatedState:
-        return "Terminated - thread has terminated but storage has not yet been reclaimed (i.e. waiting to be joined)";
-    case TThread::kFinishedState:
-        return "Finished - thread has finished";
-    case TThread::kCancelingState:
-        return "Canceling - thread in process of canceling";
-    case TThread::kCanceledState:
-        return "Canceled - thread has been canceled";
-    case TThread::kDeletingState:
-        return "Deleting - thread in process of deleting";
-    };
-    return "Unknown";
-}
Index: unk/MagicSoft/Cosy/base/MThread.h
===================================================================
--- /trunk/MagicSoft/Cosy/base/MThread.h	(revision 8842)
+++ 	(revision )
@@ -1,104 +1,0 @@
-#ifndef MARS_MThread
-#define MARS_MThread
-
-#ifndef ROOT_TThread
-#include <TThread.h>
-#endif
-
-/*
-class MyThread : public TThread
-{
-    friend class MyThreadX;
-
-private:
-
-    virtual Int_t Thread() = 0;
-    static void *MapThread(void *arg)
-    {
-        // GetPriority();     High: -1 - -20, Norm: 0, Low: 1-20
-        // pthread_setschedprio(SelfId(), priority);
-        // 0: ok,
-
-        MyThread *th = (MyThread*)arg;
-        return (void*)th->Thread();
-    }
-
-public:
-    MyThread(EPriority pri = kNormalPriority)
-        : TThread(MapThread, this, pri) { }
-    MyThread(const char *thname, EPriority pri = kNormalPriority)
-        : TThread(thname, MapThread, this, pri) { }
-};
-*/
-
-class MyThreadX
-{
-private:
-    TThread fThread;
-
-    Int_t fNumCleanups;
-
-    virtual void CleanUp() { }
-    static void MapCleanUp(void *arg)
-    {
-        MyThreadX *th = (MyThreadX*)arg;
-        th->CleanUp();
-    }
-
-    virtual Int_t Thread() = 0;
-    static void *MapThread(void *arg)
-    {
-        // GetPriority();     High: -1 - -20, Norm: 0, Low: 1-20
-        // pthread_setschedprio(SelfId(), priority);
-        // 0: ok,
-
-        TThread::CleanUpPush((void*)&MapCleanUp, arg);
-
-        MyThreadX *th = (MyThreadX*)arg;
-        return (void*)th->Thread();
-    }
-
-public:
-    MyThreadX(TThread::EPriority pri = TThread::kNormalPriority)
-        : fThread(MapThread, this, pri), fNumCleanups(0) { }
-    MyThreadX(const char *thname, TThread::EPriority pri = TThread::kNormalPriority)
-        : fThread(thname, MapThread, this, pri), fNumCleanups(0) { }
-    virtual ~MyThreadX() { }
-
-//        Int_t            Kill() { return fThread.Kill(); }
-        Int_t            RunThread(void *arg = 0) { return fThread.Run(); }
-//    void             SetPriority(EPriority pri)
-//    void             Delete(Option_t *option="") { TObject::Delete(option); }
-//    EPriority        GetPriority() const { return fPriority; }
-        TThread::EState  GetThreadState() const { return fThread.GetState(); }
-        Long_t           GetThreadId() const { return fThread.GetId(); }
-//        Long_t           Join(void **ret = 0) { return fThread.Join(ret); }
-
-        TString GetThreadStateStr() const;
-
-        Bool_t IsThreadRunning()  const { return fThread.GetState()==TThread::kRunningState; }
-        Bool_t IsThreadCanceled() const { return fThread.GetState()==TThread::kCancelingState; }
-
-        // Send cancel request and wait for cancellation
-        // 13 is returned if thread is not running,
-        // the return code of Join otherwise
-        Int_t CancelThread(void **ret = 0) {
-            const Int_t rc = fThread.Kill();
-            if (rc==13) // Thread not running
-                return rc;
-            return fThread.Join(ret);
-        }
-
-        // This is a version of usleep which is a cancel point
-        static void Sleep(UInt_t us)
-        {
-            TThread::SetCancelOn();
-            usleep(us);
-            TThread::SetCancelOff();
-        }
-
-
-//   ClassDef(MyThreadX,0)  // Thread class
-};
-
-#endif
Index: /trunk/MagicSoft/Cosy/base/Makefile
===================================================================
--- /trunk/MagicSoft/Cosy/base/Makefile	(revision 8842)
+++ /trunk/MagicSoft/Cosy/base/Makefile	(revision 8843)
@@ -17,5 +17,4 @@
 
 SRCFILES = MStopwatch.cc \
-           MThread.cc \
 	   MTimeout.cc \
            MStar.cc \
Index: /trunk/MagicSoft/Cosy/base/msgqueue.cc
===================================================================
--- /trunk/MagicSoft/Cosy/base/msgqueue.cc	(revision 8842)
+++ /trunk/MagicSoft/Cosy/base/msgqueue.cc	(revision 8843)
@@ -7,5 +7,5 @@
 // This creates the Message queue thread,
 //
-MsgQueue::MsgQueue() : MyThreadX("MsqQueue"), fNextMsg(0), fNextPtr(0)
+MsgQueue::MsgQueue() : MThread("MsqQueue"), fNextMsg(0), fNextPtr(0)
 {
     RunThread();
Index: /trunk/MagicSoft/Cosy/base/msgqueue.h
===================================================================
--- /trunk/MagicSoft/Cosy/base/msgqueue.h	(revision 8842)
+++ /trunk/MagicSoft/Cosy/base/msgqueue.h	(revision 8843)
@@ -13,5 +13,5 @@
 #define WM_QUIT 0xffff
 
-class MsgQueue : public MyThreadX
+class MsgQueue : public MThread
 {
 private:
Index: /trunk/MagicSoft/Cosy/candrv/nodedrv.cc
===================================================================
--- /trunk/MagicSoft/Cosy/candrv/nodedrv.cc	(revision 8842)
+++ /trunk/MagicSoft/Cosy/candrv/nodedrv.cc	(revision 8843)
@@ -485,5 +485,5 @@
 // least one Nodeguard message was answered.
 //
-class NodeGuard : public MyThreadX
+class NodeGuard : public MThread
 {
     Double_t fTimeoutTime;     //[s]
@@ -497,5 +497,5 @@
 public:
     NodeGuard(NodeDrv *drv, Int_t guard, Int_t ltf, Bool_t canopen)
-        : MyThreadX("NodeGuard"), fGuardTime(guard/1000.), fLifeTimeFactor(ltf), fIsCanOpen(canopen), fDrv(drv) { }
+        : MThread("NodeGuard"), fGuardTime(guard/1000.), fLifeTimeFactor(ltf), fIsCanOpen(canopen), fDrv(drv) { }
 
     void Reset(const timeval_t *tv=NULL)
Index: /trunk/MagicSoft/Cosy/candrv/vmodican.h
===================================================================
--- /trunk/MagicSoft/Cosy/candrv/vmodican.h	(revision 8842)
+++ /trunk/MagicSoft/Cosy/candrv/vmodican.h	(revision 8843)
@@ -25,5 +25,5 @@
 class CanOpen;
 
-class VmodIcan : public Interface, public MyThreadX
+class VmodIcan : public Interface, public MThread
 {
 private:
Index: /trunk/MagicSoft/Cosy/main/MCosy.h
===================================================================
--- /trunk/MagicSoft/Cosy/main/MCosy.h	(revision 8842)
+++ /trunk/MagicSoft/Cosy/main/MCosy.h	(revision 8843)
@@ -53,5 +53,5 @@
 class MDriveCom;
 
-class MTTalk : public MyThreadX
+class MTTalk : public MThread
 {
 private:
@@ -61,5 +61,5 @@
 
 public:
-    MTTalk(MCosy *cosy) : MyThreadX("MTTalk"), fCosy(cosy)
+    MTTalk(MCosy *cosy) : MThread("MTTalk"), fCosy(cosy)
     {
         //SetPriority(10);
Index: /trunk/MagicSoft/Cosy/main/MTracking.h
===================================================================
--- /trunk/MagicSoft/Cosy/main/MTracking.h	(revision 8842)
+++ /trunk/MagicSoft/Cosy/main/MTracking.h	(revision 8843)
@@ -14,5 +14,5 @@
 class SlaStars;
 
-class MTracking : public MSlewing, public MyThreadX
+class MTracking : public MSlewing, public MThread
 {
 private:
@@ -42,5 +42,5 @@
 
 public:
-    MTracking(MCosy *cosy) : MSlewing(cosy), MyThreadX("MTracking"), fTrackAcc(0.1), fTrackDec(0.1), fOut(0) { }
+    MTracking(MCosy *cosy) : MSlewing(cosy), MThread("MTracking"), fTrackAcc(0.1), fTrackDec(0.1), fOut(0) { }
 
     void TrackPosition(const RaDec &dst); // ra, dec [rad]
Index: /trunk/MagicSoft/Cosy/tcpip/MTcpIpIO.cc
===================================================================
--- /trunk/MagicSoft/Cosy/tcpip/MTcpIpIO.cc	(revision 8842)
+++ /trunk/MagicSoft/Cosy/tcpip/MTcpIpIO.cc	(revision 8843)
@@ -208,5 +208,5 @@
             delete fServSock;
             fServSock=NULL;
-            MyThreadX::Sleep(5000000);
+            MThread::Sleep(5000000);
             continue;
         }
Index: /trunk/MagicSoft/Cosy/tcpip/MTcpIpIO.h
===================================================================
--- /trunk/MagicSoft/Cosy/tcpip/MTcpIpIO.h	(revision 8842)
+++ /trunk/MagicSoft/Cosy/tcpip/MTcpIpIO.h	(revision 8843)
@@ -15,5 +15,5 @@
 
 // A generalized class for receiving over tcp/ip
-class MTcpIpI : public MyThreadX
+class MTcpIpI : public MThread
 {
 private:
@@ -25,5 +25,5 @@
 
 public:
-    MTcpIpI(Int_t rx) : MyThreadX(Form("MTcpIpI::%d", rx)), fPortRx(rx) { /*RunThread();*/ }
+    MTcpIpI(Int_t rx) : MThread(Form("MTcpIpI::%d", rx)), fPortRx(rx) { /*RunThread();*/ }
     ~MTcpIpI() { CancelThread(); }
 };
Index: /trunk/MagicSoft/Cosy/videodev/Camera.cc
===================================================================
--- /trunk/MagicSoft/Cosy/videodev/Camera.cc	(revision 8842)
+++ /trunk/MagicSoft/Cosy/videodev/Camera.cc	(revision 8843)
@@ -34,5 +34,5 @@
 using namespace std;
 
-Camera::Camera(PixClient &client, Int_t nch) : MyThreadX("Camera"), fClient(client), fVideo(0)
+Camera::Camera(PixClient &client, Int_t nch) : MThread("Camera"), fClient(client), fVideo(0)
 {
     fVideo = new MVideo;
Index: /trunk/MagicSoft/Cosy/videodev/Camera.h
===================================================================
--- /trunk/MagicSoft/Cosy/videodev/Camera.h	(revision 8842)
+++ /trunk/MagicSoft/Cosy/videodev/Camera.h	(revision 8843)
@@ -13,5 +13,5 @@
 class PixClient;
 
-class Camera : public PixGetter, public MyThreadX
+class Camera : public PixGetter, public MThread
 {
 private:
