rust-embedded / bare-metal

Abstractions common to microcontrollers
Apache License 2.0
116 stars 17 forks source link

Mention why `Mutex::borrow` doesn't return &mut T #17

Closed jonas-schievink closed 4 years ago

jonas-schievink commented 5 years ago

This mirrors what the std Mutex does.

If this turns out to be unsafe, at least there should be a comment explaining why only a &T is provided.

hannobraun commented 5 years ago

It's unsafe :)

More info: https://github.com/japaric/bare-metal/issues/16

jonas-schievink commented 5 years ago

Bump. This is now purely a documentation change explaining why this would be unsafe.

axos88 commented 5 years ago

Can we add an unsafe fn returning it?