Changeset 2518 for trunk/MagicSoft/Cosy/base
- Timestamp:
- 11/17/03 13:50:48 (21 years ago)
- Location:
- trunk/MagicSoft/Cosy/base
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/base/MTimeout.cc
r911 r2518 1 1 #include "MTimeout.h" 2 3 #include <TSystem.h> 4 5 MTimeout::MTimeout(unsigned long ms=500) : fTimeout((ULong_t)gSystem->Now()+ms) 6 { 7 // Use SetTime to change the timing 8 // if (ms) TurnOn(); // Add to system list 9 } 10 11 bool MTimeout::HasTimedOut() 12 { 13 return fTimeout<(ULong_t)gSystem->Now(); 14 } 15 16 void MTimeout::Start(unsigned long ms=500) 17 { 18 fTimeout = (ULong_t)gSystem->Now()+ms; 19 //Reset(); // reset before adding 20 //TurnOn(); // Add to system list 21 } -
trunk/MagicSoft/Cosy/base/MTimeout.h
r1702 r2518 1 #ifndef MTIMEOUT_H2 #define MTIMEOUT_H1 #ifndef COSY_MTimeout 2 #define COSY_MTimeout 3 3 4 #include <TTimer.h>4 //#include <TTimer.h> 5 5 6 class MTimeout : public TTimer6 class MTimeout// : public TTimer 7 7 { 8 /* 8 9 Bool_t Notify() 9 10 { … … 11 12 return kFALSE; 12 13 } 14 */ 15 unsigned long fTimeout; 13 16 14 17 public: 15 MTimeout(Long_t ms=500) : TTimer(ms, kFALSE) 16 { 17 // Use SetTime to change the timing 18 if (ms) TurnOn(); // Add to system list 19 } 18 MTimeout(unsigned long ms=500); 20 19 21 void Start() 22 { 23 Reset(); // reset before adding 24 TurnOn(); // Add to system list 25 } 20 bool HasTimedOut(); 21 22 void Start(unsigned long ms=500); 26 23 }; 27 24 -
trunk/MagicSoft/Cosy/base/msgqueue.cc
r1953 r2518 89 89 // a PostMsg is processed correctly 90 90 // 91 pthread_mutex_lock(&fMuxMsg);91 fMuxMsg.Lock(); 92 92 fBreak = 0; 93 pthread_mutex_unlock(&fMuxMsg);93 fMuxMsg.UnLock(); 94 94 95 95 #ifdef DEBUG … … 130 130 cout << "MsgQueue::PostMsg: Locking MsgQueue mutex..." << flush; 131 131 #endif 132 pthread_mutex_lock(&fMuxMsg);132 fMuxMsg.Lock(); 133 133 #ifdef DEBUG 134 134 cout << "done." << endl; … … 145 145 if (fBreak) 146 146 { 147 pthread_mutex_unlock(&fMuxMsg);147 fMuxMsg.UnLock(); 148 148 #ifdef DEBUG 149 149 cout << "------------> MsgQueue::PostMsg: Proc still pending... Message IGNORED." << endl; … … 176 176 #endif 177 177 fStart = 1; 178 pthread_mutex_unlock(&fMuxMsg);178 fMuxMsg.UnLock(); 179 179 #ifdef DEBUG 180 180 cout << "done." << endl; -
trunk/MagicSoft/Cosy/base/msgqueue.h
r1273 r2518 6 6 #define WM_NULL 0x0000 7 7 #define WM_QUIT 0xffff 8 9 #ifndef ROOT_TMutex 10 #include <TMutex.h> 11 #endif 8 12 9 13 class MsgQueue … … 19 23 void *fRc; // Proc return code 20 24 21 pthread_t fThread; 22 pthread_mutex_t fMuxMsg; 23 pthread_cond_t fCondMsg; 24 pthread_mutex_t fMuxRc; 25 pthread_cond_t fCondRc; 25 pthread_t fThread; 26 TMutex fMuxMsg; 26 27 27 28 static void *MapThread(void *arg); … … 36 37 37 38 virtual void *Proc(int msg, void *mp1); 39 void *Proc(int msg) { return Proc(msg, 0); } 38 40 39 41 void *PostMsg(int msg, void *mp1, int size); 42 void *PostMsg(int msg) { return PostMsg(msg, 0, 0); } 40 43 }; 41 44 -
trunk/MagicSoft/Cosy/base/timer.cc
r2278 r2518 136 136 const char *Timer::GetTimeStr() 137 137 { 138 sprintf(fDateStr, "% d/%02d/%02d %d:%02d:%02d.%06li",138 sprintf(fDateStr, "%2d/%02d/%02d %d:%02d:%02d.%06li", 139 139 fYea, fMon, fDay, fHor, fMin, fSec, (long)(1000000.0*fMs)); 140 140 … … 146 146 char text[256]; 147 147 148 sprintf(text, "% d/%02d/%02d %d:%02d:%02d.%01li",148 sprintf(text, "%2d/%02d/%02d %d:%02d:%02d.%01li", 149 149 t.fYea, t.fMon, t.fDay, t.fHor, t.fMin, t.fSec, (long)(10.0*t.fMs)); 150 150
Note:
See TracChangeset
for help on using the changeset viewer.