DescriptionFix WaitableEvent and ConditionVariable::TimedWait to use monotonic time on non-Mac non-NaCl posix
Both use a relative time, and it's important that this relative time is consistent with the wall clock when the system time gets adjusted (e.g. NTP, tlsdate, etc.). The monotonic clock, when available, has that property. Unfortunately, by default, pthread_cond_timedwait takes the system time which doesn't have that property.
On Linux/Chrome OS, we use pthread_condattr_setclock which lets us use the monotonic clock. On Android, we use the non-portable pthread_cond_timedwait_monotonic_np which has the same effect.
Unfortunately, neither is supported by NaCl.
Mac can use the non-portable pthread_cond_timedwait_relative_np which uses a relative time.
BUG=293736
R=thakis@chromium.org
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=226378
Patch Set 1 #Patch Set 2 : fix android #Patch Set 3 : fix_nacl #Patch Set 4 : really fix nacl #Patch Set 5 : add test #
Total comments: 1
Patch Set 6 : rebase #Patch Set 7 : fix mac #
Total comments: 2
Patch Set 8 : Add NaCl comment #Patch Set 9 : rebase #
Total comments: 1
Messages
Total messages: 14 (0 generated)
|