Hello Alexey Serbin, Dan Burkert, Todd Lipcon,
I'd like you to do a code review. Please visit
http://gerrit.cloudera.org:8080/9695
to review the following change.
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
---
M src/kudu/util/condition_variable.cc
1 file changed, 13 insertions(+), 1 deletion(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/95/9695/1
--
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: newchange
Gerrit-Change-Id: If33329376af7a350e66c1d26c7bb57d7e5416236
Gerrit-Change-Number: 9695
Gerrit-PatchSet: 1
Gerrit-Owner: Adar Dembo <[email protected]>
Gerrit-Reviewer: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Dan Burkert <[email protected]>
Gerrit-Reviewer: Todd Lipcon <[email protected]>