version 2.33.0
piMinSleep() method
This commit is contained in:
@@ -162,7 +162,7 @@ private:
|
||||
return;
|
||||
}
|
||||
if (ret > 0) {
|
||||
piMSleep(PIP_MIN_MSLEEP);
|
||||
piMinSleep();
|
||||
return;
|
||||
}
|
||||
diag_.received(1);
|
||||
|
||||
@@ -402,7 +402,7 @@ bool PIThread::waitForFinish(int timeout_msecs) {
|
||||
if (!running_) return true;
|
||||
if (timeout_msecs < 0) {
|
||||
while (running_) {
|
||||
piMSleep(PIP_MIN_MSLEEP);
|
||||
piMinSleep();
|
||||
#ifdef WINDOWS
|
||||
if (!isExists(PRIVATE->thread)) {
|
||||
unlock();
|
||||
@@ -414,7 +414,7 @@ bool PIThread::waitForFinish(int timeout_msecs) {
|
||||
}
|
||||
tmf_.reset();
|
||||
while (running_ && tmf_.elapsed_m() < timeout_msecs) {
|
||||
piMSleep(PIP_MIN_MSLEEP);
|
||||
piMinSleep();
|
||||
#ifdef WINDOWS
|
||||
if (!isExists(PRIVATE->thread)) {
|
||||
unlock();
|
||||
@@ -430,12 +430,12 @@ bool PIThread::waitForStart(int timeout_msecs) {
|
||||
if (running_) return true;
|
||||
if (timeout_msecs < 0) {
|
||||
while (!running_)
|
||||
piMSleep(PIP_MIN_MSLEEP);
|
||||
piMinSleep();
|
||||
return true;
|
||||
}
|
||||
tms_.reset();
|
||||
while (!running_ && tms_.elapsed_m() < timeout_msecs)
|
||||
piMSleep(PIP_MIN_MSLEEP);
|
||||
piMinSleep();
|
||||
return tms_.elapsed_m() < timeout_msecs;
|
||||
}
|
||||
|
||||
|
||||
@@ -648,11 +648,11 @@ bool PITimer::stop(bool wait) {
|
||||
bool PITimer::waitForFinish(int timeout_msecs) {
|
||||
if (timeout_msecs < 0) {
|
||||
while (isRunning())
|
||||
piMSleep(PIP_MIN_MSLEEP);
|
||||
piMinSleep();
|
||||
return true;
|
||||
}
|
||||
PITimeMeasurer tm;
|
||||
while (isRunning() && tm.elapsed_m() < timeout_msecs)
|
||||
piMSleep(PIP_MIN_MSLEEP);
|
||||
piMinSleep();
|
||||
return tm.elapsed_m() < timeout_msecs;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user