Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ff13ac62 authored by yusukes's avatar yusukes Committed by android-build-merger
Browse files

Merge "Prevent WaitForProperty() from using ~100% of CPU time on 32bit builds"...

Merge "Prevent WaitForProperty() from using ~100% of CPU time on 32bit builds" am: 7c6b0242 am: b94bff1d
am: 37fe697a

Change-Id: I289bb1f2621b37986ed12522974e585e01571dc5
parents 8166a938 37fe697a
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@

#include <algorithm>
#include <chrono>
#include <limits>
#include <string>

#include <android-base/parseint.h>
@@ -109,7 +110,7 @@ static void WaitForPropertyCallback(void* data_ptr, const char*, const char* val
static void DurationToTimeSpec(timespec& ts, const std::chrono::milliseconds d) {
  auto s = std::chrono::duration_cast<std::chrono::seconds>(d);
  auto ns = std::chrono::duration_cast<std::chrono::nanoseconds>(d - s);
  ts.tv_sec = s.count();
  ts.tv_sec = std::min<std::chrono::seconds::rep>(s.count(), std::numeric_limits<time_t>::max());
  ts.tv_nsec = ns.count();
}