]> git.lizzy.rs Git - rust.git/commitdiff
Rewrite Condvar::wait_timeout and make it public
authorSteven Fackler <sfackler@gmail.com>
Wed, 14 Jan 2015 05:24:26 +0000 (21:24 -0800)
committerSteven Fackler <sfackler@gmail.com>
Fri, 16 Jan 2015 17:17:37 +0000 (09:17 -0800)
**The implementation is a direct adaptation of libcxx's
condition_variable implementation.**

pthread_cond_timedwait uses the non-monotonic system clock. It's
possible to change the clock to a monotonic via pthread_cond_attr, but
this is incompatible with static initialization. To deal with this, we
calculate the timeout using the system clock, and maintain a separate
record of the start and end times with a monotonic clock to be used for
calculation of the return value.


No differences found