Changeset 8823


Ignore:
Timestamp:
01/24/08 09:10:00 (17 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Cosy
Files:
9 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Cosy/candrv/nodedrv.cc

    r8813 r8823  
    484484// least one Nodeguard message was answered.
    485485//
    486 class NodeGuard : public MThread
     486class NodeGuard : public MyThreadX
    487487{
    488488    Double_t fTimeoutTime;     //[s]
     
    496496public:
    497497    NodeGuard(NodeDrv *drv, Int_t guard, Int_t ltf, Bool_t canopen)
    498         : MThread(false), fGuardTime(guard/1000.), fLifeTimeFactor(ltf), fIsCanOpen(canopen), fDrv(drv) { }
     498        : MyThreadX("NodeGuard"), fGuardTime(guard/1000.), fLifeTimeFactor(ltf), fIsCanOpen(canopen), fDrv(drv) { }
    499499
    500500    void Reset(const timeval_t *tv=NULL)
     
    509509    }
    510510
    511     void *Thread()
     511    Int_t Thread()
    512512    {
    513513        Reset();
    514514
    515         while (!HasStopFlag())
     515        while (!IsThreadCanceled())
    516516        {
    517517            // Sending nodeguards seems to result in
     
    527527            const Double_t t0 = t+fGuardTime;
    528528
    529             while (!HasStopFlag() && (double)t<t0 && (double)t<fTimeoutTime)
     529            while ((double)t<t0 && (double)t<fTimeoutTime)
    530530            {
    531                 usleep(5);
     531                Sleep(100);
    532532                t.Now();
    533533            }
     
    553553
    554554    fGuard = new NodeGuard(this, fGuardTime, fLifeTimeFactor, real);
    555     fGuard->Start();
     555    fGuard->RunThread();
    556556
    557557    lout << "- " << GetNodeName() << ": Guarding (" << dec;
Note: See TracChangeset for help on using the changeset viewer.