Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify tick channel #456

Merged
merged 2 commits into from Dec 25, 2019
Merged

Simplify tick channel #456

merged 2 commits into from Dec 25, 2019

Conversation

ghost
Copy link

@ghost ghost commented Dec 24, 2019

Due to the way recv() was implemented for the tick flavor, there was always some unintended drift because we had a loop that sleeps until the next tick and then checks if the tick happened.

This PR simplifies the recv() method and fixes the drift. Now we try to receive the message first and then sleep until the next tick.

Fixes #406

@ghost
Copy link
Author

ghost commented Dec 25, 2019

bors r+

bors bot added a commit that referenced this pull request Dec 25, 2019
456: Simplify tick channel r=stjepang a=stjepang

Due to the way `recv()` was implemented for the tick flavor, there was always some unintended drift because we had a loop that sleeps until the next tick and then checks if the tick happened.

This PR simplifies the `recv()` method and fixes the drift. Now we try to receive the message first and *then* sleep until the next tick.

Fixes #406

Co-authored-by: Stjepan Glavina <[email protected]>
@bors
Copy link
Contributor

bors bot commented Dec 25, 2019

Build succeeded

@bors bors bot merged commit 7098bec into crossbeam-rs:master Dec 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

channel::tick() behavior questions
0 participants