Freeze when using std::sync::Barrier
The following example freezes on Redox, whereas it runs to completion on Linux.
use std::sync::{Arc, Barrier};
fn main() {
let barrier = Arc::new(Barrier::new(5));
let threads = (0..4).map(|_| {
let barrier = Arc::clone(&barrier);
std::thread::spawn(move || {
barrier.wait();
})
}).collect::<Vec<_>>();
barrier.wait();
for thread in threads {
thread.join().unwrap();
}
}
The bug likely pertains to relibc
, but given that there have been futex
bugs in the past, I decided to file the issue here instead.