summaryrefslogtreecommitdiffstats
path: root/libprocessgroup/processgroup.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 /libprocessgroup/processgroup.cpp
parentf77d8b04528775e7a2e22255bb9a46b0e1df8ef1 (diff)
downloadcore-290a228fdca935ab2e702db77516758314900c3a.tar.gz
core-290a228fdca935ab2e702db77516758314900c3a.tar.bz2
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 'libprocessgroup/processgroup.cpp')
-rw-r--r--libprocessgroup/processgroup.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/libprocessgroup/processgroup.cpp b/libprocessgroup/processgroup.cpp
index 7c1542990..eb6672762 100644
--- a/libprocessgroup/processgroup.cpp
+++ b/libprocessgroup/processgroup.cpp
@@ -31,12 +31,15 @@
#include <chrono>
#include <memory>
#include <mutex>
+#include <thread>
#include <android-base/logging.h>
#include <private/android_filesystem_config.h>
#include <processgroup/processgroup.h>
+using namespace std::chrono_literals;
+
// Uncomment line below use memory cgroups for keeping track of (forked) PIDs
// #define USE_MEMCG 1
@@ -288,7 +291,7 @@ int killProcessGroup(uid_t uid, int initialPid, int signal)
while ((processes = killProcessGroupOnce(uid, initialPid, signal)) > 0) {
LOG(VERBOSE) << "killed " << processes << " processes for processgroup " << initialPid;
if (retry > 0) {
- usleep(5 * 1000); // 5ms
+ std::this_thread::sleep_for(5ms);
--retry;
} else {
LOG(ERROR) << "failed to kill " << processes << " processes for processgroup "