-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
sync: add a rwlock()
method to owned RwLock
guards
#6418
Conversation
6bc0332
to
5eb4835
Compare
Adds a `rwlock()` method returning a reference to the original `Arc<RwLock>` to the `Owned*` guards.
5eb4835
to
fb4fa82
Compare
rwlock()
method to owned RwLock
guardsrwlock()
method to owned RwLock
guards
This is reasonable enough, but if we are adding it, then I would like us to be consistent and add it to all of the guards. I am okay with replacing the |
Although replacing the The only way to make this work (AFAIK) would be to update Hope this all makes sense! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
Adds a
rwlock()
method returning a reference to the originalArc<RwLock>
to theOwned*
guards.Motivation
Mutex
guards andSemaphore
permits already have similar methods.Solution
A similar,
rwlock()
, method is added to theOwned*
guards. The "normal" guards don't actually hold a reference to the originalRwLock
and I don't think that it can be added to them without changing these types' definitions.