|
28 | 28 | //! * A [null] pointer is *never* valid, not even for accesses of [size zero][zst].
|
29 | 29 | //! * All pointers (except for the null pointer) are valid for all operations of
|
30 | 30 | //! [size zero][zst].
|
| 31 | +//! * All accesses performed by functions in this module are *non-atomic* in the sense |
| 32 | +//! of [atomic operations] used to synchronize between threads. This means it is |
| 33 | +//! undefined behavior to perform two concurrent accesses to the same location from different |
| 34 | +//! threads unless both accesses only read from memory. Notice that this explicitly |
| 35 | +//! includes [`read_volatile`] and [`write_volatile`]: Volatile accesses cannot |
| 36 | +//! be used for inter-thread synchronization. |
31 | 37 | //! * The result of casting a reference to a pointer is valid for as long as the
|
32 | 38 | //! underlying object is live and no reference (just raw pointers) is used to
|
33 | 39 | //! access the same memory.
|
|
56 | 62 | //! [ub]: ../../reference/behavior-considered-undefined.html
|
57 | 63 | //! [null]: ./fn.null.html
|
58 | 64 | //! [zst]: ../../nomicon/exotic-sizes.html#zero-sized-types-zsts
|
| 65 | +//! [atomic operations]: ../../std/sync/atomic/index.html |
59 | 66 | //! [`copy`]: ../../std/ptr/fn.copy.html
|
60 | 67 | //! [`offset`]: ../../std/primitive.pointer.html#method.offset
|
61 | 68 | //! [`read_unaligned`]: ./fn.read_unaligned.html
|
62 | 69 | //! [`write_unaligned`]: ./fn.write_unaligned.html
|
| 70 | +//! [`read_volatile`]: ./fn.read_volatile.html |
| 71 | +//! [`write_volatile`]: ./fn.write_volatile.html |
63 | 72 | //! [`NonNull::dangling`]: ./struct.NonNull.html#method.dangling
|
64 | 73 |
|
65 | 74 | #![stable(feature = "rust1", since = "1.0.0")]
|
|
0 commit comments