[Modify] Polish it
This commit is contained in:
parent
3a0a661300
commit
0a31183ca7
@ -136,11 +136,13 @@ namespace WebSocketSharp.Net
|
|||||||
|
|
||||||
private static void complete (HttpListenerAsyncResult asyncResult)
|
private static void complete (HttpListenerAsyncResult asyncResult)
|
||||||
{
|
{
|
||||||
|
lock (asyncResult._sync) {
|
||||||
asyncResult._completed = true;
|
asyncResult._completed = true;
|
||||||
|
|
||||||
var waitHandle = asyncResult._waitHandle;
|
var waitHandle = asyncResult._waitHandle;
|
||||||
if (waitHandle != null)
|
if (waitHandle != null)
|
||||||
waitHandle.Set ();
|
waitHandle.Set ();
|
||||||
|
}
|
||||||
|
|
||||||
var callback = asyncResult._callback;
|
var callback = asyncResult._callback;
|
||||||
if (callback == null)
|
if (callback == null)
|
||||||
@ -168,7 +170,6 @@ namespace WebSocketSharp.Net
|
|||||||
? new HttpListenerException (995, "The listener is closed.")
|
? new HttpListenerException (995, "The listener is closed.")
|
||||||
: exception;
|
: exception;
|
||||||
|
|
||||||
lock (_sync)
|
|
||||||
complete (this);
|
complete (this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -188,7 +189,6 @@ namespace WebSocketSharp.Net
|
|||||||
_context = context;
|
_context = context;
|
||||||
_syncCompleted = syncCompleted;
|
_syncCompleted = syncCompleted;
|
||||||
|
|
||||||
lock (_sync)
|
|
||||||
complete (this);
|
complete (this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user