Do nothing in KestrelThread.Stop if libuv fails to load

This prevents DllNotFoundExceptions from being masked by NullReferenceExceptions
This commit is contained in:
Stephen Halter 2015-10-28 16:18:51 -07:00
parent 0e3e42826c
commit 1722150ee9
1 changed files with 9 additions and 0 deletions

View File

@ -30,6 +30,7 @@ namespace Microsoft.AspNet.Server.Kestrel
private Queue<CloseHandle> _closeHandleRunning = new Queue<CloseHandle>();
private object _workSync = new Object();
private bool _stopImmediate = false;
private bool _initCompleted = false;
private ExceptionDispatchInfo _closeError;
private IKestrelTrace _log;
@ -58,6 +59,11 @@ namespace Microsoft.AspNet.Server.Kestrel
public void Stop(TimeSpan timeout)
{
if (!_initCompleted)
{
return;
}
Post(OnStop, null);
if (!_thread.Join((int)timeout.TotalMilliseconds))
{
@ -195,8 +201,11 @@ namespace Microsoft.AspNet.Server.Kestrel
catch (Exception ex)
{
tcs.SetException(ex);
return;
}
_initCompleted = true;
try
{
var ran1 = _loop.Run();