rust/library/std/src/sync
Trevor Gross 5f17779a03
Rollup merge of #140369 - jplatte:mutex-rwlock-data-ptr, r=Amanieu
Add data_ptr method to Mutex and RwLock

Implementation of https://github.com/rust-lang/rust/issues/140368 / https://github.com/rust-lang/libs-team/issues/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:

- Return a `LockResult` or not?
- Return `*mut T` like existing APIs (`Cell::as_ptr` / `MaybeUninit::as[_mut]_ptr` / `Vec::as_ptr` / ...) or be more precise and return `NonNull<T>`?
2025-05-28 10:28:07 -04:00
..
mpmc docs: fix typos 2025-05-22 22:47:36 +08:00
poison Add more docs to new data_ptr methods 2025-05-21 08:07:43 +02:00
barrier.rs Move std::sync unit tests to integration tests 2025-01-26 10:28:05 +00:00
lazy_lock.rs Rollup merge of #129334 - ChayimFriedman2:more-lazy-methods, r=Amanieu 2025-05-10 16:26:01 +02:00
mod.rs Implement UniqueArc 2025-03-22 15:14:49 +08:00
mpsc.rs Move std::sync unit tests to integration tests 2025-01-26 10:28:05 +00:00
once_lock.rs Update documentation of OnceLock::get_or_init. 2025-05-08 09:33:38 +02:00
poison.rs use generic Atomic type where possible 2025-04-27 02:18:08 +03:00
reentrant_lock.rs Add ReentrantLock::data_ptr 2025-05-21 08:07:43 +02:00