rust/library/std
Jacob Pratt 5ed1fa84a5
Rollup merge of #134389 - rust-wasi-web:condvar-no-threads, r=m-ou-se
Condvar: implement wait_timeout for targets without threads

This always falls back to sleeping since there is no way to notify a condvar on a target without threads.

Even on a target that has no threads the following code is a legitimate use case:

```rust
use std::sync::{Condvar, Mutex};
use std::time::Duration;

fn main() {
    let cv = Condvar::new();
    let mutex = Mutex::new(());
    let mut guard = mutex.lock().unwrap();

    cv.notify_one();

    let res;
    (guard, res) = cv.wait_timeout(guard, Duration::from_secs(3)).unwrap();
    assert!(res.timed_out());
}
```
2025-01-08 00:52:45 -05:00
..
benches Reformat use declarations. 2024-07-29 08:26:52 +10:00
src Rollup merge of #134389 - rust-wasi-web:condvar-no-threads, r=m-ou-se 2025-01-08 00:52:45 -05:00
tests Fix and undeprecate home_dir() 2024-11-04 03:06:09 +00:00
build.rs Enable f128 tests on all non-buggy platforms 🎉 2024-11-03 19:33:04 -06:00
Cargo.toml sync to actual dep verions of backtrace 2025-01-03 15:26:18 +03:00