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

util: add pollable Semaphore #3444

Merged
merged 3 commits into from
Jan 20, 2021
Merged

util: add pollable Semaphore #3444

merged 3 commits into from
Jan 20, 2021

Conversation

Darksonn
Copy link
Contributor

The Semaphore type has no poll_acquire method as it uses an intrusive linked list, but the recommendation I want to make when people ask for a poll_send on mpsc is to combine the unbounded channel with a semaphore. However this requires a pollable semaphore.

@Darksonn Darksonn added A-tokio-util Area: The tokio-util crate M-sync Module: tokio/sync labels Jan 19, 2021
Copy link
Member

@carllerche carllerche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks

@Darksonn Darksonn merged commit 27b2d68 into master Jan 20, 2021
@Darksonn Darksonn deleted the poll-semaphore branch January 20, 2021 08:53
aknuds1 pushed a commit to aknuds1/tokio that referenced this pull request Jan 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio-util Area: The tokio-util crate M-sync Module: tokio/sync
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants