Adar Dembo has uploaded this change for review. ( http://gerrit.cloudera.org:8080/9699
Change subject: condition_variable: fix fallout from commit 038c3eb for macOS ...................................................................... condition_variable: fix fallout from commit 038c3eb for macOS Normally pthread_cond_timedwait expects wallclock time in the 'abstime' parameter, and on macOS, it's not possible to change that to monotonic time. As a result, commit 038c3eb caused all sorts of timing issues on macOS for any code doing deadline-based waiting on condition variables. As an example, ThreadJoiner configured to wait in 1000ms increments would instead use 10us increments. This patch fixes this by switching back to relative time waiting, as was done in ConditionVariable::TimedWait prior to that commit. I tried doing the same on Linux so as to chain WaitUntil into WaitFor, but that leads to overflows when the deadline is Max() due to a subtraction and then an addition of potentially different values of Now(). Change-Id: If33329376af7a350e66c1d26c7bb57d7e5416236 Reviewed-on: http://gerrit.cloudera.org:8080/9695 Reviewed-by: Dan Burkert <[email protected]> Tested-by: Adar Dembo <[email protected]> Reviewed-by: Todd Lipcon <[email protected]> (cherry picked from commit a469506115fbc13c1fe835ae9c1a75a5544bf64e) --- M src/kudu/util/condition_variable.cc 1 file changed, 13 insertions(+), 1 deletion(-) git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/99/9699/1 -- To view, visit http://gerrit.cloudera.org:8080/9699 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: branch-1.7.x Gerrit-MessageType: newchange Gerrit-Change-Id: If33329376af7a350e66c1d26c7bb57d7e5416236 Gerrit-Change-Number: 9699 Gerrit-PatchSet: 1 Gerrit-Owner: Adar Dembo <[email protected]>
