Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/dev/wd33c93a.rs
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,13 @@ impl FifoDevice for Wd33c93a {
impl Device for Wd33c93a {
fn step(&self, _cycles: u64) {}
fn stop(&self) {
self.running.store(false, Ordering::SeqCst);
// Under the state lock: the worker checks `running` holding it and
// then waits, so a store and notify between the two would be lost
// and the join below would wait forever.
{
let _state = self.state.lock();
self.running.store(false, Ordering::SeqCst);
}
self.cond.notify_all();
if let Some(t) = self.thread.lock().take() {
let _ = t.join();
Expand Down
Loading