fix waitLoop
This commit is contained in:
@@ -13,10 +13,13 @@ PIClientServer::Server * createServer() {
|
||||
|
||||
bool waitLoop(std::function<bool()> exit_loop, const PISystemTime & timeout) {
|
||||
PITimeMeasurer tm;
|
||||
while (!exit_loop() && (tm.elapsed() < timeout)) {
|
||||
while (tm.elapsed() < timeout) {
|
||||
if (exit_loop()) {
|
||||
return true;
|
||||
}
|
||||
piMinSleep();
|
||||
}
|
||||
return tm.elapsed() < timeout;
|
||||
return false;
|
||||
}
|
||||
|
||||
template<typename Client>
|
||||
|
||||
Reference in New Issue
Block a user