rust/tests/pass/concurrency
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
..
channels.rs rustup 2022-06-16 11:18:09 -07:00
concurrent_caller_location.rs rename test suite directories 2022-06-01 10:53:38 -04:00
data_race.rs Disable weak memory emulation on scheduler-dependent data race tests 2022-06-06 19:15:23 +01:00
disable_data_race_detector.rs rename test suite directories 2022-06-01 10:53:38 -04:00
issue1643.rs rename test suite directories 2022-06-01 10:53:38 -04:00
libc_pthread_cond.rs rename test suite directories 2022-06-01 10:53:38 -04:00
linux-futex.rs Reduce the number of iterations 2022-06-13 18:24:19 +01:00
simple.rs rename test suite directories 2022-06-01 10:53:38 -04:00
simple.stderr bless tests 2022-06-06 20:17:39 -04:00
spin_loop.rs remove warning about thread support being experimental 2022-06-06 20:16:02 -04:00
spin_loops_nopreempt.rs make scheduler preemptive, with configurable preemption rate 2022-06-06 20:16:02 -04:00
spin_loops.stderr Update experimental threading warning 2022-06-06 19:15:59 +01:00
sync_singlethread.rs rename test suite directories 2022-06-01 10:53:38 -04:00
sync.rs make scheduler preemptive, with configurable preemption rate 2022-06-06 20:16:02 -04:00
sync.stdout rename test suite directories 2022-06-01 10:53:38 -04:00
thread_locals.rs rename test suite directories 2022-06-01 10:53:38 -04:00
tls_lib_drop_single_thread.rs rename test suite directories 2022-06-01 10:53:38 -04:00
tls_lib_drop_single_thread.stderr rename test suite directories 2022-06-01 10:53:38 -04:00
tls_lib_drop.rs add stdlib test for TLS dtor order 2022-06-07 07:58:21 -04:00
tls_lib_drop.stdout rename test suite directories 2022-06-01 10:53:38 -04:00
tls_pthread_drop_order.rs rename test suite directories 2022-06-01 10:53:38 -04:00