Skip to content
Snippets Groups Projects
Commit 44729d3e authored by Tristan Matthews's avatar Tristan Matthews
Browse files

* #9782: use nanosleep instead of usleep

parent 318fba03
No related branches found
No related tags found
No related merge requests found
......@@ -37,6 +37,7 @@
#include "manager.h"
#include "noncopyable.h"
#include "dbus/configurationmanager.h"
#include <ctime>
class AlsaThread : public ost::Thread {
public:
......@@ -107,7 +108,8 @@ bool AlsaLayer::openDevice(snd_pcm_t **pcm, const std::string &dev, snd_pcm_stre
// Retry if busy, since dmix plugin may not have released the device yet
for (int tries = 0; tries < MAX_RETRIES and err == -EBUSY; ++tries) {
usleep(10000);
const struct timespec req = {0, 10000000};
nanosleep(&req, 0);
err = snd_pcm_open(pcm, dev.c_str(), stream, 0);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment