Commit 0ebdd408 authored by Alexander Morozov's avatar Alexander Morozov

PassiveTimer::setTiming(timeMS) returns 0 if timeMS == WaitUpTime

parent ab2a07ac
...@@ -68,7 +68,7 @@ bool ThrPassiveTimer::wait(timeout_t timeMS) ...@@ -68,7 +68,7 @@ bool ThrPassiveTimer::wait(timeout_t timeMS)
terminated = 0; terminated = 0;
{ {
tmutex->lock(); tmutex->lock();
timeMS = PassiveTimer::setTiming(timeMS); // PassiveTimer- timeout_t tmMS = PassiveTimer::setTiming(timeMS); // PassiveTimer-
if( timeMS == WaitUpTime ) if( timeMS == WaitUpTime )
{ {
while( !terminated ) // , ... while( !terminated ) // , ...
...@@ -77,7 +77,7 @@ bool ThrPassiveTimer::wait(timeout_t timeMS) ...@@ -77,7 +77,7 @@ bool ThrPassiveTimer::wait(timeout_t timeMS)
else else
{ {
unsigned long sec, msec; unsigned long sec, msec;
omni_thread::get_time(&sec,&msec, timeMS/1000, (timeMS%1000)*1000000 ); omni_thread::get_time(&sec,&msec, tmMS/1000, (tmMS%1000)*1000000 );
// cout <<"timer: "<< timeMS/1000 << "[] " << (timeMS%1000)*1000000 <<"[]" << endl; // cout <<"timer: "<< timeMS/1000 << "[] " << (timeMS%1000)*1000000 <<"[]" << endl;
tcondx->timedwait(sec, msec); tcondx->timedwait(sec, msec);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment