[Modify] Replace it

This commit is contained in:
sta 2021-02-12 19:40:13 +09:00
parent c56eae9207
commit 89b0d866be

View File

@ -181,8 +181,19 @@ namespace WebSocketSharp.Net
internal void Complete (Exception exception)
{
_exception = exception;
Complete ();
lock (_sync) {
if (_completed)
return;
_completed = true;
_exception = exception;
if (_waitHandle != null)
_waitHandle.Set ();
if (_callback != null)
_callback.BeginInvoke (this, ar => _callback.EndInvoke (ar), null);
}
}
#endregion