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

Expose ability to acquire multiple permits #2598

Closed
wants to merge 4 commits into from

Conversation

kornelski
Copy link
Contributor

@kornelski kornelski commented Jun 9, 2020

Closes #1550

Rebased on #2605 and #2607

@Darksonn Darksonn added A-tokio Area: The main tokio crate C-enhancement Category: A PR with an enhancement or bugfix. M-sync Module: tokio/sync labels Jun 9, 2020
@Darksonn Darksonn requested a review from hawkw June 9, 2020 22:11
Copy link
Contributor

@Darksonn Darksonn left a comment

Choose a reason for hiding this comment

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

Can you add the new async fns to tokio/tests/async_send_sync.rs?

Copy link
Member

@hawkw hawkw left a comment

Choose a reason for hiding this comment

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

Overall, this looks great. I had a few thoughts on API design I'd love to hear your thoughts on.

Also, it would be good to get a +1 from @carllerche before merging this — I don't remember off the top of my head if there was any more specific motivation for not exposing multiple permits in the public Semaphore API, or if it just hadn't been done yet.

tokio/src/sync/semaphore.rs Outdated Show resolved Hide resolved
tokio/src/sync/semaphore.rs Outdated Show resolved Hide resolved
tokio/src/sync/semaphore.rs Outdated Show resolved Hide resolved
tokio/src/sync/semaphore.rs Show resolved Hide resolved
@Darksonn
Copy link
Contributor

Can you merge master for CI fixes?

@tuxzz
Copy link

tuxzz commented Jul 2, 2020

Seems we should pub use semaphore::{SemaphorePermits, OwnedSemaphorePermits}; in tokio/src/sync/mod.rs?

PR sent: kornelski#1

@tuxzz
Copy link

tuxzz commented Jul 2, 2020

PR sent: kornelski#2
PR reason: #1550 (comment)

@Darksonn
Copy link
Contributor

Closing due to #2605 (comment)

@Darksonn Darksonn closed this Jul 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate C-enhancement Category: A PR with an enhancement or bugfix. M-sync Module: tokio/sync
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tokio-sync: Acquire n permits from a semaphore
4 participants