[Modify] Lock it
This commit is contained in:
parent
41d89493a5
commit
b4c82165c6
@ -822,14 +822,16 @@ namespace WebSocketSharp.Net
|
||||
throw new ArgumentException (msg, "asyncResult");
|
||||
}
|
||||
|
||||
if (ares.EndCalled) {
|
||||
var msg = "This IAsyncResult instance cannot be reused.";
|
||||
lock (ares.SyncRoot) {
|
||||
if (ares.EndCalled) {
|
||||
var msg = "This IAsyncResult instance cannot be reused.";
|
||||
|
||||
throw new InvalidOperationException (msg);
|
||||
throw new InvalidOperationException (msg);
|
||||
}
|
||||
|
||||
ares.EndCalled = true;
|
||||
}
|
||||
|
||||
ares.EndCalled = true;
|
||||
|
||||
if (!ares.IsCompleted)
|
||||
ares.AsyncWaitHandle.WaitOne ();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user