Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewrite Condvar::wait_timeout and make it public
**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.
- Loading branch information
Showing
8 changed files
with
343 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
08f6380
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
saw approval from alexcrichton
at sfackler@08f6380
08f6380
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merging sfackler/rust/wait_timeout = 08f6380 into auto
08f6380
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
status: {"merge_sha": "fb8d9f4ce24f577364402d120c0d5d734e0f90f3"}
08f6380
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sfackler/rust/wait_timeout = 08f6380 merged ok, testing candidate = fb8d9f4
08f6380
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some tests failed:
failure: http://buildbot.rust-lang.org/builders/auto-mac-64-opt/builds/3168
exception: http://buildbot.rust-lang.org/builders/auto-linux-32-opt/builds/3160
exception: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-t/builds/3160
exception: http://buildbot.rust-lang.org/builders/auto-linux-64-opt/builds/3163
exception: http://buildbot.rust-lang.org/builders/auto-linux-64-x-android-t/builds/3150
exception: http://buildbot.rust-lang.org/builders/auto-win-32-opt/builds/2829
exception: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-t/builds/2827
exception: http://buildbot.rust-lang.org/builders/auto-win-64-opt/builds/1665
exception: http://buildbot.rust-lang.org/builders/auto-win-64-nopt-t/builds/1657
08f6380
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
saw approval from alexcrichton
at sfackler@08f6380
08f6380
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merging sfackler/rust/wait_timeout = 08f6380 into auto
08f6380
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
status: {"merge_sha": "378fb5846d2d8dbc5ab24a5e92794c5c39d492dc"}
08f6380
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sfackler/rust/wait_timeout = 08f6380 merged ok, testing candidate = 378fb58
08f6380
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all tests pass:
success: http://buildbot.rust-lang.org/builders/auto-mac-32-opt/builds/3176
success: http://buildbot.rust-lang.org/builders/auto-mac-64-opt/builds/3169
success: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-t/builds/3171
success: http://buildbot.rust-lang.org/builders/auto-linux-32-opt/builds/3161
success: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-t/builds/3161
success: http://buildbot.rust-lang.org/builders/auto-linux-64-opt/builds/3164
success: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-t/builds/3157
success: http://buildbot.rust-lang.org/builders/auto-linux-64-x-android-t/builds/3151
success: http://buildbot.rust-lang.org/builders/auto-win-32-opt/builds/2830
success: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-t/builds/2828
success: http://buildbot.rust-lang.org/builders/auto-win-64-opt/builds/1666
success: http://buildbot.rust-lang.org/builders/auto-win-64-nopt-t/builds/1658
08f6380
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fast-forwarding master to auto = 378fb58
08f6380
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fast-forwarding master to auto = 378fb58