Skip to content

Commit

Permalink
Add a name to unpacking thread
Browse files Browse the repository at this point in the history
  • Loading branch information
utkarshgupta137 committed Jul 31, 2023
1 parent 48769f2 commit 71dbbc6
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 71dbbc6

Please sign in to comment.