Use synchronous locks for Peer
state
We hold these locks for a short amount of time anyway, and using an async lock could cause parallel sends to happen in an order different than the order in which `send`/`request` was called. Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
310def2923
commit
9e4b118214
4 changed files with 36 additions and 44 deletions
|
@ -72,8 +72,8 @@ impl FakeServer {
|
|||
server
|
||||
}
|
||||
|
||||
pub async fn disconnect(&self) {
|
||||
self.peer.disconnect(self.connection_id()).await;
|
||||
pub fn disconnect(&self) {
|
||||
self.peer.disconnect(self.connection_id());
|
||||
self.connection_id.lock().take();
|
||||
self.incoming.lock().take();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue