Skip to content

Add a statically-initializable mutex type to libstd #9714

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

Closed
sfackler opened this issue Oct 4, 2013 · 1 comment
Closed

Add a statically-initializable mutex type to libstd #9714

sfackler opened this issue Oct 4, 2013 · 1 comment

Comments

@sfackler
Copy link
Member

sfackler commented Oct 4, 2013

There are certain cases where you need a global mutex (see #9713 for one example) and the only reasonable way to do that without something like Go's init functions is a mutex type with a static initializer similar to PTHREAD_MUTEX_INITIALIZER from libpthread.

@alexcrichton
Copy link
Member

Closing as a dupe of #9105. One of the requirements listed in that issue is to have statically initialized variants, so I believe that closing that would close this as well.

I think that we're going to have to have a statically initialized mutex which is "slow on the first lock" and "fast everywhere else" which I personally think is OK. Having a statically initialized mutex would be very nice to have though (even as just a proof of concept).

flip1995 pushed a commit to flip1995/rust that referenced this issue Nov 21, 2022
Fix `bool_to_int_with_if` false positive with `if let`

Fixes rust-lang#9706

changelog: FP: [`bool_to_int_with_if`]: Now ignores `if let` statements
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants