Add data_ptr method to Mutex and RwLock by jplatte · Pull Request #140369 · rust-lang/rust (original) (raw)

Implementation of #140368 / rust-lang/libs-team#531.

I tried to write a useful safety section about when it is safe to read or write through the returned pointers, but couldn't come up with something nice. Hoping this PR is still useful without that. I'm happy to add any doc strings other people come up with if needed before merge, of course.

Unresolved questions: