Amanieu / parking_lot

Compact and efficient synchronization primitives for Rust. Also provides an API for creating custom synchronization primitives.
Apache License 2.0
2.77k stars 217 forks source link

Fix inaccurate documentation of `wait_while`, `wait_while_until` & `wait_while_for` #427

Closed Jupeyy closed 3 months ago

Jupeyy commented 9 months ago

The current documentation can be interpreted incorrectly. For example if you wait for a condition that is already false, the current documentation suggests that the current thread will still block.

see https://github.com/rust-lang/rust/pull/121405

Amanieu commented 8 months ago

I think the new docs are actually harder to read than the old ones. Maybe it might be worth copying the latest docs from the standard library's Condvar if they are clearer: https://doc.rust-lang.org/nightly/std/sync/struct.Condvar.html#method.wait

Jupeyy commented 3 months ago

They are wrong too, and I seem not be able to write docs that are clear enough. Maybe a native speaker or someone with more experience is better suited. Thanks.