-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Description
The following code deadlocks on my machine. You might have to run several times to hit the bug.
extern crate crossbeam;
extern crate multiqueue;
fn main() {
const MESSAGES: usize = 1_000_000;
const THREADS: usize = 2;
let (tx, rx) = multiqueue::mpmc_queue(MESSAGES as u64);
crossbeam::scope(|s| {
for _ in 0..THREADS {
let tx = tx.clone();
s.spawn(move || {
for _ in 0..MESSAGES / THREADS {
while tx.try_send(()).is_err() {}
}
});
}
for _ in 0..THREADS {
let rx = rx.clone();
s.spawn(move || {
for _ in 0..MESSAGES / THREADS {
rx.recv().unwrap();
}
});
}
});
}Metadata
Metadata
Assignees
Labels
No labels