Skip to content

Commit

Permalink
Merge pull request #189 from honzuki/deadlock_hazard
Browse files Browse the repository at this point in the history
Fix potential deadlock in the executor
  • Loading branch information
nrc authored Oct 5, 2024
2 parents c54cc31 + d690d23 commit b291184
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/02_04_executor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ impl Spawner {
future: Mutex::new(Some(future)),
task_sender: self.task_sender.clone(),
});
self.task_sender.send(task).expect("too many tasks queued");
self.task_sender.try_send(task).expect("too many tasks queued");
}
}
// ANCHOR_END: spawn_fn
Expand All @@ -74,7 +74,7 @@ impl ArcWake for Task {
let cloned = arc_self.clone();
arc_self
.task_sender
.send(cloned)
.try_send(cloned)
.expect("too many tasks queued");
}
}
Expand Down

0 comments on commit b291184

Please sign in to comment.