Stop waiting when elapsed time is equal to or greater than the timeout,
rather than strictly greater than. This avoids a rare problem where the
loop manages to complete at exactly the timeout time and then makes a
call to wait(0), which waits indefinitely until another thread notifies
it instead of timing out after 0 ms.

Test: local unit testing
Bug: 113100523

Change-Id: If23dc50e2bf58d0d928d47807ec792c92ff47ee1
1 file changed