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