summaryrefslogtreecommitdiff
path: root/libunwindstack/tests/MemoryFileTest.cpp
diff options
context:
space:
mode:
authorTom Cherry <tomcherry@google.com>2017-03-24 16:52:29 -0700
committerTom Cherry <tomcherry@google.com>2017-03-27 18:05:58 -0700
commit3d5729402ed14093cfc5385aa4cc67ce90b9b780 (patch)
tree35f3e934679d6b2d4bf5a20ab51aaeb859001c20 /libunwindstack/tests/MemoryFileTest.cpp
parentb15429c0eade8a5f9b456c5f0aa57eec697e9ff2 (diff)
Fix timeouts for android::base::WaitForProperty*
std::chrono doesn't handle integer overflow, so using std::chrono::milliseconds::max() to indicate an infinite timeout is not handled well in the current code. It causes an 'absolute_timeout' earlier in time than 'now' and causes the associated WaitForProperty* functions to return immediately. Also, any duration_cast from relative_timeout to nanoseconds would cause the same issue, as it would overflow in the conversion and result in an invalid results. This change prevents any duration_casts of relative_timeout to nanoseconds and replaces the logic to wait on an absolute timeout with logic that compares the time elapsed to the provided relative timeout. This change also includes a test that std::chrono::milliseconds::max() does not return immediately and that negative values do return immediately. Test: Boot bullhead + libbase_test Change-Id: I335bfa7ba71e86c20119a0ed46014cad44361162
Diffstat (limited to 'libunwindstack/tests/MemoryFileTest.cpp')
0 files changed, 0 insertions, 0 deletions