Skip to content

Commit f3e4c2c

Browse files
committed
Update
1 parent c9d8b64 commit f3e4c2c

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/Servers/IIS/AspNetCoreModuleV2/RequestHandlerLib/filewatcher.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ FILE_WATCHER::FILE_WATCHER() :
1313
m_hChangeNotificationThread(NULL),
1414
m_fThreadExit(FALSE),
1515
_fTrackDllChanges(FALSE),
16-
m_copied(false)
16+
m_copied(false),
17+
m_pShutdownEvent(nullptr)
1718
{
1819
m_pShutdownEvent = CreateEvent(
1920
nullptr, // default security attributes
@@ -425,9 +426,12 @@ FILE_WATCHER::StopMonitor()
425426
InterlockedExchange(&_lStopMonitorCalled, 1);
426427
// signal the file watch thread to exit
427428
PostQueuedCompletionStatus(m_hCompletionPort, 0, FILE_WATCHER_SHUTDOWN_KEY, NULL);
428-
WaitForMonitor(20000);
429+
WaitForMonitor(200);
429430
// See if this waits.
430-
WaitForSingleObject(m_pShutdownEvent, 120000);
431+
if (_fTrackDllChanges && m_pShutdownEvent != nullptr)
432+
{
433+
WaitForSingleObject(m_pShutdownEvent, 120000);
434+
}
431435

432436
// Release application reference
433437
_pApplication.reset(nullptr);

0 commit comments

Comments
 (0)