Skip to content

Commit

Permalink
Fix racy Endpoint::wait_idle
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralith committed Jan 8, 2023
1 parent c88a6ec commit 112a2f6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion quinn/src/endpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,10 @@ impl Endpoint {
if endpoint.connections.is_empty() {
break;
}
// Construct future while lock is held to avoid race
self.inner.shared.idle.notified()
}
self.inner.shared.idle.notified().await;
.await;
}
}
}
Expand Down

0 comments on commit 112a2f6

Please sign in to comment.