rust/library/std/src/sys/solid
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
..
abi kmc-solid: Implement FileDesc::duplicate 2022-01-28 15:02:44 +09:00
alloc.rs Add SOLID targets 2021-09-28 11:31:47 +09:00
env.rs Add SOLID targets 2021-09-28 11:31:47 +09:00
error.rs Add SOLID targets 2021-09-28 11:31:47 +09:00
fs.rs kmc-solid: Use the filesystem thread-safety wrapper 2022-02-10 13:33:35 +09:00
io.rs Add SOLID targets 2021-09-28 11:31:47 +09:00
memchr.rs Add SOLID targets 2021-09-28 11:31:47 +09:00
mod.rs std: use an event flag based thread parker on SOLID 2022-05-18 12:18:51 +02:00
net.rs Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00
os.rs Rename RWLock to RwLock in std::sys. 2022-04-06 16:33:53 +02:00
path.rs Fix absolute issues 2022-02-08 14:57:35 +00:00
rwlock.rs Make all {Mutex, Condvar, RwLock}::new #[inline]. 2022-06-06 13:49:23 +02:00
stdio.rs Add SOLID targets 2021-09-28 11:31:47 +09:00
thread_local_dtor.rs Add SOLID targets 2021-09-28 11:31:47 +09:00
thread_local_key.rs Add SOLID targets 2021-09-28 11:31:47 +09:00
time.rs Use Rust 2021 prelude in std itself. 2022-05-09 11:12:32 +02:00