summaryrefslogtreecommitdiffstats
path: root/init/util.cpp
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2016-11-14 17:08:47 -0800
committerElliott Hughes <enh@google.com>2016-11-14 17:08:47 -0800
commit290a228fdca935ab2e702db77516758314900c3a (patch)
treebdb1606d717b50aded201e69bb2f29daa451b73e /init/util.cpp
parentf77d8b04528775e7a2e22255bb9a46b0e1df8ef1 (diff)
downloadsystem_core-290a228fdca935ab2e702db77516758314900c3a.tar.gz
system_core-290a228fdca935ab2e702db77516758314900c3a.tar.bz2
system_core-290a228fdca935ab2e702db77516758314900c3a.zip
Switch fastboot/init/libprocessgroup to std::this_thread::sleep_for.
Bug: http://b/32878766 Test: boots Change-Id: Ie0ddfb7e60f2da5f6eefbb10c83a92e88c137ae3
Diffstat (limited to 'init/util.cpp')
-rw-r--r--init/util.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/init/util.cpp b/init/util.cpp
index bde4efb62..cb5a094e3 100644
--- a/init/util.cpp
+++ b/init/util.cpp
@@ -34,6 +34,8 @@
#include <sys/types.h>
#include <sys/un.h>
+#include <thread>
+
#include <android-base/file.h>
#include <android-base/logging.h>
#include <android-base/stringprintf.h>
@@ -326,7 +328,7 @@ int wait_for_file(const char* filename, std::chrono::nanoseconds timeout) {
struct stat sb;
if (stat(filename, &sb) != -1) return 0;
- usleep(10000);
+ std::this_thread::sleep_for(10ms);
}
return -1;
}