Skip to content

Commit

Permalink
Merge pull request #38 from utkarshgupta137/main
Browse files Browse the repository at this point in the history
Add a name to unpacking thread
  • Loading branch information
jonhoo committed Aug 20, 2023
2 parents 48769f2 + 71dbbc6 commit 469c547
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,11 +344,13 @@ impl<T> Bus<T> {
// so we don't have to wait for unpark() to return in broadcast_inner
// sending on a channel without contention is cheap, unparking is not
let (unpark_tx, unpark_rx) = mpsc::unbounded::<thread::Thread>();
thread::spawn(move || {
for t in unpark_rx.iter() {
t.unpark();
}
});
let _ = thread::Builder::new()
.name("bus_unparking".to_owned())
.spawn(move || {
for t in unpark_rx.iter() {
t.unpark();
}
});

Bus {
state: inner,
Expand Down

0 comments on commit 469c547

Please sign in to comment.