-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Consider dropping Freeze from the MutexArc bounds #12142
Comments
I think it was intended to prevent locking the same lock twice. I don't think consistent behaviour (one of deadlocking, recursive locking or reporting an error) can be provided when lock elision or hardware transactional memory is used as it may simply succeed due to lack of a conflict during the lock scope. |
Ah indeed, the recursive lock was the reason it was added. |
I don't think we'll be able to prevent recursive locking if we switch to RAII locks anyway, so we may still want to remove the bounds. It's just going to be sad to lack lock elision as it becomes more and more important. I guess we could make a separate lock type... |
… r=lnicola feat: Sort items by trait definition assist This PR replaces the "Sort **methods** by trait definition" assist with a "Sort **items** by trait definition" assist that sorts all items, not just methods. 
I see this was added as part of #7473, but I don't understand why
MutexArc
needs aFreeze
bound foraccess
andaccess_cond
. I was under the impression thatFreeze
was just needed for safely sharing read-only data among threads, but aMutexArc
only hands out one&mut T
at a time, so I don't think this should be necessary.The text was updated successfully, but these errors were encountered: