critical-section
critical-section copied to clipboard
Pluggable critical section
While testing an [embassy](https://embassy.dev/) project on Windows using Miri, I encountered a hard-to-diagnose violation involving a conflict between writing to and dropping critical-section's `GLOBAL_GUARD`. I believe the change proposed in...
Mutexes are mostly used for static variables, and also a lot of times the variable needs to be initialized later. The current Mutex implementation doesn't feel very ergonomic: 1. to...
The core idea of a mutex is to make `!Sync` types `Sync`. This is exactly what this line does https://github.com/rust-embedded/critical-section/blob/3a328a84040b721034a1b084e4a9dea8218a90f8/src/mutex.rs#L191 `!Sync` type == cannot function properly when used concurrently behind...
Alternative to #53. Closes #52.
This leads to slightly better code generation in some cases where the mutex contents are accessed multiple times in a row. Closes: #52
For reasons I'm still investigating (that is, how this got by all tests), a bug sneaked into #40, so things don't even build with that feature enabled. This PR fixes...
Added a `?Sized` constraint to `T` in `Mutex`, allowing it to work with unsized types, such as trait objects.