We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 41d8949 commit b4c8216Copy full SHA for b4c8216
websocket-sharp/Net/HttpListener.cs
@@ -822,13 +822,15 @@ public HttpListenerContext EndGetContext (IAsyncResult asyncResult)
822
throw new ArgumentException (msg, "asyncResult");
823
}
824
825
- if (ares.EndCalled) {
826
- var msg = "This IAsyncResult instance cannot be reused.";
+ lock (ares.SyncRoot) {
+ if (ares.EndCalled) {
827
+ var msg = "This IAsyncResult instance cannot be reused.";
828
- throw new InvalidOperationException (msg);
829
- }
+ throw new InvalidOperationException (msg);
830
+ }
831
- ares.EndCalled = true;
832
+ ares.EndCalled = true;
833
834
835
if (!ares.IsCompleted)
836
ares.AsyncWaitHandle.WaitOne ();
0 commit comments