3d5729402e
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 |
||
---|---|---|
.. | ||
include/android-base | ||
.clang-format | ||
Android.bp | ||
CPPLINT.cfg | ||
endian_test.cpp | ||
errors_test.cpp | ||
errors_unix.cpp | ||
errors_windows.cpp | ||
file.cpp | ||
file_test.cpp | ||
logging.cpp | ||
logging_test.cpp | ||
parsedouble_test.cpp | ||
parseint_test.cpp | ||
parsenetaddress.cpp | ||
parsenetaddress_test.cpp | ||
properties.cpp | ||
properties_test.cpp | ||
quick_exit.cpp | ||
quick_exit_test.cpp | ||
stringprintf.cpp | ||
stringprintf_test.cpp | ||
strings.cpp | ||
strings_test.cpp | ||
test_main.cpp | ||
test_utils.cpp | ||
utf8.cpp | ||
utf8_test.cpp |