rust/src
bors c4dd3f4ef9 Auto merge of #2228 - cbeuw:futex-fix, r=RalfJung
Prevent futex_wait from actually waiting if a concurrent waker was executed before us

Fixes #2223

Two SC fences were placed in `futex_wake` (after the caller has changed `addr`), and in `futex_wait` (before we read `addr`). This guarantees that `futex_wait` sees the value written to `addr` before the last `futex_wake` call, should one exists, and avoid going into sleep with no one else to wake us up.
ada7b72a87/src/concurrency/weak_memory.rs (L324-L326)

Earlier I proposed to use `fetch_add(0)` to read the latest value in MO, though this isn't the proper way to do it and breaks aliasing: syscall caller may pass in a `*const` from a `&` and Miri complains about write to a `SharedReadOnly` location, causing this test to fail.
ada7b72a87/tests/pass/concurrency/linux-futex.rs (L56-L68)
2022-06-18 15:10:56 +00:00
..
bin Auto merge of #2203 - RalfJung:deprecate, r=oli-obk 2022-06-13 10:23:42 +00:00
concurrency Auto merge of #2227 - RalfJung:doc, r=RalfJung 2022-06-11 15:50:11 +00:00
helpers Replace as casts in llvm.x86.addcarry.64 implementation 2022-04-30 10:33:55 -07:00
shims Auto merge of #2228 - cbeuw:futex-fix, r=RalfJung 2022-06-18 15:10:56 +00:00
stacked_borrows rustup 2022-05-29 14:06:35 +02:00
diagnostics.rs rename ExperimentalUb → StackedBorrowsUb 2022-06-11 17:42:23 -07:00
eval.rs Add mandatory cargo_doc 2022-06-11 10:59:57 +02:00
helpers.rs Add assert_target_os_is_unix function 2022-06-11 18:50:36 +02:00
intptrcast.rs enable number validity checking and ptr::invalid checking by default 2022-05-25 16:17:41 +02:00
lib.rs Add #![feature(yeet_expr)] 2022-06-12 18:39:44 -07:00
machine.rs rustup 2022-06-08 12:10:54 -04:00
mono_hash_map.rs some clippy-induced cleanup 2022-06-08 08:06:32 -04:00
operator.rs
range_map.rs
stacked_borrows.rs rename ExperimentalUb → StackedBorrowsUb 2022-06-11 17:42:23 -07:00
sync.rs Inline _create() calls and add assertions 2022-05-12 21:06:17 +01:00
thread.rs make scheduler preemptive, with configurable preemption rate 2022-06-06 20:16:02 -04:00
vector_clock.rs set_at_index sets the default value (0) if index doesn't exist in the other vector 2022-06-06 19:15:20 +01:00