[Modify] Polish it

This commit is contained in:
sta 2021-04-21 19:49:53 +09:00
parent dc420c7b7e
commit 9b6c7d300e

View File

@ -449,16 +449,12 @@ namespace WebSocketSharp.Net
private void cleanupWaitQueue (Exception exception) private void cleanupWaitQueue (Exception exception)
{ {
HttpListenerAsyncResult[] aress = null; if (_waitQueue.Count == 0)
return;
lock (_waitQueueSync) { var aress = _waitQueue.ToArray ();
if (_waitQueue.Count == 0)
return;
aress = _waitQueue.ToArray (); _waitQueue.Clear ();
_waitQueue.Clear ();
}
foreach (var ares in aress) foreach (var ares in aress)
ares.Complete (exception); ares.Complete (exception);