You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 30, 2025. It is now read-only.
After publishing the initial version, I noticed a few things:
The trait was, for some reason, designed to be implemented for references. This is very confusing and almost no other trait does this. I believe the original motivation was to make it harder to cause deadlocks, but implementations will usually be for &SomeMutex, which means you can still deadlock. This also makes the lock method hard to call.
The trait confuses the "interior mutability" aspect of mutexes with the "making Send data Sync" aspect, leading to expensive implementations (eg. Added arch specific mutex implementation cortex-m#209). Since we already have plenty of data structures like cells for interior mutability, it is more important to cover the "making Send data Sync" part.
I'm not yet sure how the trait should look, and what it would take to make it still useful for RTFM etc., but I think the current design is not optimal.