]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
prevent-crash-at-shutdown-20040320
authorJeffrey Altman <jaltman@mit.edu>
Sat, 20 Mar 2004 18:42:16 +0000 (18:42 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Sat, 20 Mar 2004 18:42:16 +0000 (18:42 +0000)
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.

src/WINNT/afsd/afsd_flushvol.c

index d0dce41bbaa92e2d7058f48e17b9504a385c6528..e2238d7c92c807e4ac31fcb775bbfba067b04a17 100644 (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);
        }
 }