about summary refs log tree commit diff
path: root/compiler/rustc_interface/src/tests.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-03-06 12:19:40 +0000
committerbors <bors@rust-lang.org>2024-03-06 12:19:40 +0000
commit3314d5ce4c209e840c2e4b2c4442f6e031ae0989 (patch)
tree76e2b5df951aadb1db86b55c6efcb1f63906320e /compiler/rustc_interface/src/tests.rs
parent09bc67b9158392361780e779d32997f14cc75c39 (diff)
parentcf83d83c77eb9c5a08debc818156815ae5bf759f (diff)
downloadrust-3314d5ce4c209e840c2e4b2c4442f6e031ae0989.tar.gz
rust-3314d5ce4c209e840c2e4b2c4442f6e031ae0989.zip
Auto merge of #121956 - ChrisDenton:srwlock, r=joboet
Windows: Implement condvar, mutex and rwlock using futex

Well, the Windows equivalent: [`WaitOnAddress`,](https://learn.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-waitonaddress) [`WakeByAddressSingle`](https://learn.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-wakebyaddresssingle) and [`WakeByAddressAll`](https://learn.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-wakebyaddressall).

Note that Windows flavoured futexes can be different sizes (1, 2, 4 or 8 bytes). I took advantage of that in the `Mutex` implementation.

I also edited the Mutex implementation a bit more than necessary. I was having trouble keeping in my head what 0, 1 and 2 meant so I replaced them with consts.

I *think* we're maybe spinning a bit much. `WaitOnAddress` seems to be looping quite a bit too. But for now I've keep the implementations the same. I do wonder if it'd be worth reducing or removing our spinning on Windows.

This also adds a new shim to miri, because of course it does.

Fixes #121949
Diffstat (limited to 'compiler/rustc_interface/src/tests.rs')
0 files changed, 0 insertions, 0 deletions