mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-29 00:46:17 +02:00
portable sleep function
This commit is contained in:
parent
17879618c7
commit
951548f412
12 changed files with 35 additions and 19 deletions
|
@ -184,7 +184,7 @@ void Controller::worker()
|
|||
if (reply)
|
||||
{
|
||||
TimeProvider::getInstance().setDiff(reply->latency, reply->received - reply->sent);
|
||||
usleep(100);
|
||||
chronos::usleep(100);
|
||||
}
|
||||
}
|
||||
logO << "diff to server [ms]: " << (float)TimeProvider::getInstance().getDiffToServer<chronos::usec>().count() / 1000.f << "\n";
|
||||
|
@ -193,7 +193,7 @@ void Controller::worker()
|
|||
{
|
||||
for (size_t n=0; n<10 && active_; ++n)
|
||||
{
|
||||
usleep(100*1000);
|
||||
chronos::sleep(100);
|
||||
if (asyncException_)
|
||||
throw AsyncSnapException(exception_);
|
||||
}
|
||||
|
@ -211,7 +211,7 @@ void Controller::worker()
|
|||
stream_.reset();
|
||||
decoder_.reset();
|
||||
for (size_t n=0; (n<10) && active_; ++n)
|
||||
usleep(100*1000);
|
||||
chronos::sleep(100);
|
||||
}
|
||||
}
|
||||
logD << "Thread stopped\n";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue