Replace usleep with util::sleep_for (#19643)

* replace usleep with sleep_for

* sleep microseconds

* sleep nanoseconds

* Trigger Build
old-commit-hash: c1cf0882bd4e0fce5e1a581536f6a0e7afb640e6
This commit is contained in:
Dean Lee
2021-01-05 01:03:11 +08:00
committed by GitHub
parent df0435c933
commit bbfb751d69
13 changed files with 34 additions and 28 deletions
+3 -3
View File
@@ -465,7 +465,7 @@ struct Updater {
while(battery_cap < min_battery_cap) {
battery_cap = battery_capacity();
battery_cap_text = std::to_string(battery_cap);
usleep(1000000);
util::sleep_for(1000);
}
set_running();
}
@@ -483,7 +483,7 @@ struct Updater {
while(battery_cap < min_battery_cap) {
battery_cap = battery_capacity();
battery_cap_text = std::to_string(battery_cap);
usleep(1000000);
util::sleep_for(1000);
}
set_running();
}
@@ -756,7 +756,7 @@ struct Updater {
assert(glGetError() == GL_NO_ERROR);
// no simple way to do 30fps vsync with surfaceflinger...
usleep(30000);
util::sleep_for(30);
}
if (update_thread_handle.joinable()) {