You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// * `ptr` must be aligned to `align_of::<AtomicBool>()` (note that on some platforms this can be bigger than `align_of::<bool>()`).
2115
-
#[doc = concat!(" * `ptr` must be aligned to `align_of::<", stringify!($atomic_type),">()` (note that on some platforms this can be bigger than `align_of::<", stringify!($int_type),">()`).")]
2132
+
#[doc = concat!(" * `ptr` must be aligned to \
2133
+
`align_of::<", stringify!($atomic_type),">()` (note that on some platforms this \
2134
+
can be bigger than `align_of::<", stringify!($int_type),">()`).")]
2116
2135
/// * `ptr` must be [valid] for both reads and writes for the whole lifetime `'a`.
2117
-
/// * The value behind `ptr` must not be accessed through non-atomic operations for the whole lifetime `'a`.
2136
+
/// * Non-atomic accesses to the value behind `ptr` must have a happens-before
2137
+
/// relationship with atomic accesses via the returned value (or vice-versa).
2138
+
/// * In other words, time periods where the value is accessed atomically may not
2139
+
/// overlap with periods where the value is accessed non-atomically.
2140
+
/// * This requirement is trivially satisfied if `ptr` is never used non-atomically
2141
+
/// for the duration of lifetime `'a`. Most use cases should be able to follow
2142
+
/// this guideline.
2143
+
/// * This requirement is also trivially satisfied if all accesses (atomic or not) are
2144
+
/// done from the same thread.
2145
+
/// * This method should not be used to create overlapping or mixed-size atomic
2146
+
/// accesses, as these are not supported by the memory model.
0 commit comments