Open MarkDDR opened 3 years ago
When the following code is run, loom claims it deadlocks. This should not happen since the other thread should become unblocked and exit once the last sender gets dropped in drop(sender)
drop(sender)
Example repo with the same code
use loom::{sync::mpsc, thread}; fn main() { loom::model(|| { deadlock_example(); }) } fn deadlock_example() { let (sender, receiver) = mpsc::channel(); let handle = thread::spawn(move || { while let Ok(i) = receiver.recv() { println!("Got {}", i); } }); sender.send(0_i32).expect("thread died"); drop(sender); handle.join().expect("thread panicked"); }
This was tested to occur with both loom = "0.4.1" and the current master branch of loom at time of writing
loom = "0.4.1"
This still seems to be the case. I suppose no one is working on this?
When the following code is run, loom claims it deadlocks. This should not happen since the other thread should become unblocked and exit once the last sender gets dropped in
drop(sender)
Example repo with the same code
This was tested to occur with both
loom = "0.4.1"
and the current master branch of loom at time of writing