prevent-crash-at-shutdown-20040320

The Power Management Exit routine was instructing the thread to
terminate but was not waiting for the conclusion of the operation
before returning control to the caller.  This allows the service
to pass control to the Service Manager before cleanup was properly
completed.
This commit is contained in:
Jeffrey Altman 2004-03-20 18:42:16 +00:00 committed by Jeffrey Altman
parent aaed9b1a5a
commit e3b52b0bc6

View File

@ -341,7 +341,6 @@ afsd_ServiceFlushVolumesThreadProc(LPVOID lpParam)
case WAIT_OBJECT_0:
// termination signaled
RevertToSelf();
Sleep(500);
ExitThread(0);
break;
@ -488,6 +487,7 @@ PowerNotificationThreadExit()
if (gThreadHandle)
{
SetEvent(gThreadInfo.hEventTerminate);
WaitForSingleObject(gThreadHandle, INFINITE);
CloseHandle(gThreadHandle);
}
}