Changeset 4828 for source/ariba/utility/system/Timer.cpp
- Timestamp:
- Jul 9, 2009, 11:08:45 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
source/ariba/utility/system/Timer.cpp
r3690 r4828 84 84 } 85 85 86 void Timer::reset(){ 87 #ifndef UNDERLAY_OMNET 88 if(timerThread == NULL) return; 89 timerThread->interrupt(); 90 #else 91 #error timer interruption not implemented for omnet 92 #endif 93 } 94 86 95 void Timer::stop() { 87 96 running = false; 97 reset(); // cause the sleep to abort 88 98 } 89 99 … … 97 107 98 108 while( obj->running ) { 99 boost::this_thread::sleep( boost::posix_time::milliseconds(obj->millis) ); 109 110 try{ 111 boost::this_thread::sleep( boost::posix_time::milliseconds(obj->millis) ); 112 }catch(boost::thread_interrupted e){ 113 // exception called when Timer::reset is called 114 // don't need to handle the exception 115 } 116 100 117 if (obj->running) SystemQueue::instance().scheduleEvent( SystemEvent( obj, TimerEventType, NULL), 0 ); 101 118 if( obj->oneshot ) break;
Note:
See TracChangeset
for help on using the changeset viewer.