From 72bb55247cb82d9a1517b516dab535b9502864c4 Mon Sep 17 00:00:00 2001 From: Dean Lee Date: Mon, 11 Jan 2021 18:59:48 +0800 Subject: [PATCH] replace std::this_thread::sleep_for with util::sleep_fo (#19717) --- selfdrive/clocksd/clocksd.cc | 2 +- selfdrive/loggerd/loggerd.cc | 2 +- selfdrive/modeld/dmonitoringmodeld.cc | 2 +- selfdrive/modeld/modeld.cc | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/selfdrive/clocksd/clocksd.cc b/selfdrive/clocksd/clocksd.cc index 9bd7e917f..32d8c508c 100644 --- a/selfdrive/clocksd/clocksd.cc +++ b/selfdrive/clocksd/clocksd.cc @@ -53,7 +53,7 @@ int main() { #else // Just run at 1Hz on apple while (!do_exit){ - std::this_thread::sleep_for(std::chrono::seconds(1)); + util::sleep_for(1000); #endif uint64_t boottime = nanos_since_boot(); diff --git a/selfdrive/loggerd/loggerd.cc b/selfdrive/loggerd/loggerd.cc index a9c3e959f..42b9d1a87 100644 --- a/selfdrive/loggerd/loggerd.cc +++ b/selfdrive/loggerd/loggerd.cc @@ -216,7 +216,7 @@ void encoder_thread(int cam_idx) { VisionIpcClient vipc_client = VisionIpcClient("camerad", cam_info.stream_type, false); while (!do_exit) { if (!vipc_client.connect(false)){ - std::this_thread::sleep_for(std::chrono::milliseconds(100)); + util::sleep_for(100); continue; } diff --git a/selfdrive/modeld/dmonitoringmodeld.cc b/selfdrive/modeld/dmonitoringmodeld.cc index 18016699e..6879f40fd 100644 --- a/selfdrive/modeld/dmonitoringmodeld.cc +++ b/selfdrive/modeld/dmonitoringmodeld.cc @@ -30,7 +30,7 @@ int main(int argc, char **argv) { VisionIpcClient vipc_client = VisionIpcClient("camerad", VISION_STREAM_YUV_FRONT, true); while (!do_exit){ if (!vipc_client.connect(false)){ - std::this_thread::sleep_for(std::chrono::milliseconds(100)); + util::sleep_for(100); continue; } break; diff --git a/selfdrive/modeld/modeld.cc b/selfdrive/modeld/modeld.cc index bf9492bbd..b49d03943 100644 --- a/selfdrive/modeld/modeld.cc +++ b/selfdrive/modeld/modeld.cc @@ -122,7 +122,7 @@ int main(int argc, char **argv) { while (!do_exit){ if (!vipc_client.connect(false)){ - std::this_thread::sleep_for(std::chrono::milliseconds(100)); + util::sleep_for(100); continue; } break;