Adar Dembo has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/9695 )
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]> --- M src/kudu/util/condition_variable.cc 1 file changed, 13 insertions(+), 1 deletion(-) Approvals: Dan Burkert: Looks good to me, approved Adar Dembo: Verified Todd Lipcon: Looks good to me, but someone else must approve -- To view, visit http://gerrit.cloudera.org:8080/9695 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: If33329376af7a350e66c1d26c7bb57d7e5416236 Gerrit-Change-Number: 9695 Gerrit-PatchSet: 2 Gerrit-Owner: Adar Dembo <[email protected]> Gerrit-Reviewer: Adar Dembo <[email protected]> Gerrit-Reviewer: Alexey Serbin <[email protected]> Gerrit-Reviewer: Dan Burkert <[email protected]> Gerrit-Reviewer: Todd Lipcon <[email protected]>
