rust/library/std/src/sys/itron
Matthias Krüger c348beacea
Rollup merge of #97140 - joboet:solid_parker, r=m-ou-se
std: use an event-flag-based thread parker on SOLID

`Mutex` and `Condvar` are being replaced by more efficient implementations, which need thread parking themselves (see #93740). Therefore, the generic `Parker` needs to be replaced on all platforms where the new lock implementation will be used, which, after #96393, are SOLID, SGX and Hermit (more PRs coming soon).

SOLID, conforming to the [μITRON specification](http://www.ertl.jp/ITRON/SPEC/FILE/mitron-400e.pdf), has event flags, which are a thread parking primitive very similar to `Parker`. However, they do not make any atomic ordering guarantees (even though those can probably be assumed) and necessitate a system call even when the thread token is already available. Hence, this `Parker`, like the Windows parker, uses an extra atomic state variable.

I future-proofed the code by wrapping the event flag in a `WaitFlag` structure, as both SGX and Hermit can share the Parker implementation, they just have slightly different primitives (SGX uses signals and Hermit has a thread blocking API).

`````@kawadakk````` I assume you are the target maintainer? Could you test this for me?
2022-06-26 19:46:59 +02:00
..
time Add SOLID targets 2021-09-28 11:31:47 +09:00
abi.rs std: use an event flag based thread parker on SOLID 2022-05-18 12:18:51 +02:00
condvar.rs Use Drop instead of destroy() for locks. 2022-06-03 16:45:47 +02:00
error.rs Add SOLID targets 2021-09-28 11:31:47 +09:00
mutex.rs Make all {Mutex, Condvar, RwLock}::new #[inline]. 2022-06-06 13:49:23 +02:00
spin.rs Use Rust 2021 prelude in std itself. 2022-05-09 11:12:32 +02:00
task.rs Add SOLID targets 2021-09-28 11:31:47 +09:00
thread.rs Use Rust 2021 prelude in std itself. 2022-05-09 11:12:32 +02:00
time.rs Use Rust 2021 prelude in std itself. 2022-05-09 11:12:32 +02:00
wait_flag.rs std: fix deadlock in Parker 2022-05-19 14:37:29 +02:00