git-svn-id: svn://db.shs.com.ru/pip@699 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5

This commit is contained in:
2019-02-06 20:20:23 +00:00
parent b31352ffb1
commit b2c76a0e1b
14 changed files with 41 additions and 39 deletions

View File

@@ -364,12 +364,12 @@ bool PIThread::waitForFinish(int timeout_msecs) {
if (!running_) return true;
if (timeout_msecs < 0) {
while (running_)
msleep(1);
msleep(PIP_MIN_MSLEEP);
return true;
}
tmf_.reset();
while (running_ && tmf_.elapsed_m() < timeout_msecs)
msleep(1);
msleep(PIP_MIN_MSLEEP);
return tmf_.elapsed_m() < timeout_msecs;
}
@@ -378,12 +378,12 @@ bool PIThread::waitForStart(int timeout_msecs) {
if (running_) return true;
if (timeout_msecs < 0) {
while (!running_)
msleep(1);
msleep(PIP_MIN_MSLEEP);
return true;
}
tms_.reset();
while (!running_ && tms_.elapsed_m() < timeout_msecs)
msleep(1);
msleep(PIP_MIN_MSLEEP);
return tms_.elapsed_m() < timeout_msecs;
}
@@ -424,10 +424,10 @@ void PIThread::__thread_func__(void * t) {
ct.tmr_.reset();
double sl(0.);
while (1) {
sl = piMind(ct.delay_ - ct.tmr_.elapsed_m(), PTHREAD_MIN_MSLEEP);
sl = piMind(ct.delay_ - ct.tmr_.elapsed_m(), PIP_MIN_MSLEEP);
#ifdef WINDOWS
/*if (sl <= 1. && sl >= 0.) {
piMSleep(1.);
piMSleep(PIP_MIN_MSLEEP);
continue;
}*/
#endif