Do nothing in KestrelThread.Stop if libuv fails to load
This prevents DllNotFoundExceptions from being masked by NullReferenceExceptions
This commit is contained in:
parent
0e3e42826c
commit
1722150ee9
|
|
@ -30,6 +30,7 @@ namespace Microsoft.AspNet.Server.Kestrel
|
||||||
private Queue<CloseHandle> _closeHandleRunning = new Queue<CloseHandle>();
|
private Queue<CloseHandle> _closeHandleRunning = new Queue<CloseHandle>();
|
||||||
private object _workSync = new Object();
|
private object _workSync = new Object();
|
||||||
private bool _stopImmediate = false;
|
private bool _stopImmediate = false;
|
||||||
|
private bool _initCompleted = false;
|
||||||
private ExceptionDispatchInfo _closeError;
|
private ExceptionDispatchInfo _closeError;
|
||||||
private IKestrelTrace _log;
|
private IKestrelTrace _log;
|
||||||
|
|
||||||
|
|
@ -58,6 +59,11 @@ namespace Microsoft.AspNet.Server.Kestrel
|
||||||
|
|
||||||
public void Stop(TimeSpan timeout)
|
public void Stop(TimeSpan timeout)
|
||||||
{
|
{
|
||||||
|
if (!_initCompleted)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Post(OnStop, null);
|
Post(OnStop, null);
|
||||||
if (!_thread.Join((int)timeout.TotalMilliseconds))
|
if (!_thread.Join((int)timeout.TotalMilliseconds))
|
||||||
{
|
{
|
||||||
|
|
@ -195,8 +201,11 @@ namespace Microsoft.AspNet.Server.Kestrel
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
tcs.SetException(ex);
|
tcs.SetException(ex);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_initCompleted = true;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var ran1 = _loop.Run();
|
var ran1 = _loop.Run();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue