mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-17 06:26:55 +00:00
Rollup merge of #138000 - RalfJung:atomic-rmw, r=Amanieu
atomic: clarify that failing conditional RMW operations are not 'writes' Fixes https://github.com/rust-lang/rust/issues/136669 r? ``@Amanieu`` Cc ``@rust-lang/opsem`` ``@chorman0773`` ``@gnzlbg`` ``@briansmith``
This commit is contained in:
commit
8cf86cd68d
@ -44,8 +44,9 @@
|
||||
//! The most important aspect of this model is that *data races* are undefined behavior. A data race
|
||||
//! is defined as conflicting non-synchronized accesses where at least one of the accesses is
|
||||
//! non-atomic. Here, accesses are *conflicting* if they affect overlapping regions of memory and at
|
||||
//! least one of them is a write. They are *non-synchronized* if neither of them *happens-before*
|
||||
//! the other, according to the happens-before order of the memory model.
|
||||
//! least one of them is a write. (A `compare_exchange` or `compare_exchange_weak` that does not
|
||||
//! succeed is not considered a write.) They are *non-synchronized* if neither of them
|
||||
//! *happens-before* the other, according to the happens-before order of the memory model.
|
||||
//!
|
||||
//! The other possible cause of undefined behavior in the memory model are mixed-size accesses: Rust
|
||||
//! inherits the C++ limitation that non-synchronized conflicting atomic accesses may not partially
|
||||
|
Loading…
Reference in New Issue
Block a user