Index: trunk/MagicSoft/Cosy/base/MString.cc
===================================================================
--- trunk/MagicSoft/Cosy/base/MString.cc	(revision 4076)
+++ trunk/MagicSoft/Cosy/base/MString.cc	(revision 4076)
@@ -0,0 +1,4 @@
+#include "MString.h"
+
+ClassImp(MString);
+
Index: trunk/MagicSoft/Cosy/base/MString.h
===================================================================
--- trunk/MagicSoft/Cosy/base/MString.h	(revision 4076)
+++ trunk/MagicSoft/Cosy/base/MString.h	(revision 4076)
@@ -0,0 +1,45 @@
+#ifndef MARS_MString
+#define MARS_MString
+
+#ifndef ROOT_TString
+#include <TString.h>
+#endif
+
+#include <stdio.h>
+#include <stdarg.h>
+
+class MString : public TString
+{
+public:
+    MString &Print(const char *fmt, ...)
+    {
+        va_list ap;
+        va_start(ap, fmt);
+
+        Int_t n=256;
+
+        char *ret=0;
+
+        while (1)
+        {
+            ret = new char[n+1];
+            Int_t sz = vsnprintf(ret, n, fmt, ap);
+            if (sz<=n)
+                break;
+
+            n *= 2;
+            delete [] ret;
+        };
+
+        va_end(ap);
+
+        *static_cast<TString*>(this) = ret;
+
+        delete [] ret;
+
+        return *this;
+    }
+    ClassDef(MString, 1)
+};
+
+#endif
Index: trunk/MagicSoft/Cosy/base/coord.h
===================================================================
--- trunk/MagicSoft/Cosy/base/coord.h	(revision 2615)
+++ trunk/MagicSoft/Cosy/base/coord.h	(revision 4076)
@@ -90,4 +90,5 @@
     void Az(double d)  { fY=d; }
     void operator*=(const XY &c)    { fX*=c.X(); fY*=c.Y(); }
+    void operator/=(const XY &c)    { fX/=c.X(); fY/=c.Y(); }
     void operator-=(const AltAz &c) { fX-=c.fX; fY-=c.fY; }
     void operator+=(const AltAz &c) { fX+=c.fX; fY+=c.fY; }
@@ -117,4 +118,5 @@
     void Az(double d) { fY=d; }
     void operator*=(const XY &c)   { fX*=c.X(); fY*=c.Y(); }
+    void operator/=(const XY &c)   { fX/=c.X(); fY/=c.Y(); }
     void operator-=(const ZdAz &c) { fX-=c.fX; fY-=c.fY; }
     void operator+=(const ZdAz &c) { fX+=c.fX; fY+=c.fY; }
Index: trunk/MagicSoft/Cosy/base/msgqueue.cc
===================================================================
--- trunk/MagicSoft/Cosy/base/msgqueue.cc	(revision 2615)
+++ trunk/MagicSoft/Cosy/base/msgqueue.cc	(revision 4076)
@@ -89,7 +89,9 @@
         // a PostMsg is processed correctly
         //
-        fMuxMsg.Lock();
+        if (fMuxMsg.Lock()==13)
+            cout << "MsgQueue::Thread - mutex is already locked by this thread." << endl;
         fBreak = 0;
-        fMuxMsg.UnLock();
+        if (fMuxMsg.UnLock()==13)
+            cout << "MsgQueue::Thread - tried to unlock mutex locked by other thread." << endl;
 
 #ifdef DEBUG
@@ -130,5 +132,6 @@
     cout << "MsgQueue::PostMsg: Locking MsgQueue mutex..." << flush;
 #endif
-    fMuxMsg.Lock();
+    if (fMuxMsg.Lock()==13)
+        cout << "MsgQueue::PostMsg - mutex is already locked by this thread." << endl;
 #ifdef DEBUG
     cout << "done." << endl;
@@ -145,5 +148,6 @@
     if (fBreak)
     {
-        fMuxMsg.UnLock();
+        if (fMuxMsg.UnLock()==13)
+            cout << "MsgQueue::PostMsg - tried to unlock mutex locked by other thread." << endl;
 #ifdef DEBUG
         cout << "------------> MsgQueue::PostMsg: Proc still pending... Message IGNORED." << endl;
@@ -176,5 +180,6 @@
 #endif
     fStart = 1;
-    fMuxMsg.UnLock();
+    if (fMuxMsg.UnLock()==13)
+        cout << "MsgQueue::PostMsg - tried to unlock mutex locked by other thread." << endl;
 #ifdef DEBUG
     cout << "done." << endl;
