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

add limited timed wait to semaphore #853

Closed
steveklabnik opened this issue Feb 15, 2015 · 1 comment
Closed

add limited timed wait to semaphore #853

steveklabnik opened this issue Feb 15, 2015 · 1 comment
Labels
T-libs-api Relevant to the library API team, which will review and decide on the RFC.

Comments

@steveklabnik
Copy link
Member

Issue by drewcrawford
Thursday Jan 29, 2015 at 08:18 GMT

For earlier discussion, see rust-lang/rust#21741

This issue was labelled with: A-libs, A-threads, I-enhancement in the Rust repository


I think Semaphore could use timeout variants of acquire and access, besides just blocking forever.

The underlying Condvar already has timeout support, so it's just a matter of bubbling it up to semaphore. Looking at sempahore.rs, it seems like low-hanging fruit to add.

I think the biggest question is whether it should be called acquire_timeout and access_timeout (following Condvar's wait_timeout) or whether it should be called try_acquire and try_access (following Mutex and RwLock).

If there's a decision rendered on the syntax, this would be a good feature for a new contributor.

@petrochenkov petrochenkov added T-libs-api Relevant to the library API team, which will review and decide on the RFC. and removed A-libs labels Jan 28, 2018
@crlf0710
Copy link
Member

semaphore had been gone for long, so i think this can be closed now. @Centril

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-libs-api Relevant to the library API team, which will review and decide on the RFC.
Projects
None yet
Development

No branches or pull requests

4 participants