Merge "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."