summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/AutoShutdown/src/watcher.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/plugins/AutoShutdown/src/watcher.cpp b/plugins/AutoShutdown/src/watcher.cpp
index 71ea713e9a..a48161c85b 100644
--- a/plugins/AutoShutdown/src/watcher.cpp
+++ b/plugins/AutoShutdown/src/watcher.cpp
@@ -48,16 +48,18 @@ static void __stdcall MainThreadMapping(void *param)
HANDLE *phDoneEvent = (HANDLE*)param;
ServiceShutdown(0,TRUE); /* ensure main thread (for cpu usage shutdown) */
ServiceStopWatcher(0,0);
- if (*phDoneEvent != NULL) SetEvent(*phDoneEvent);
+ if (*phDoneEvent != NULL)
+ SetEvent(*phDoneEvent);
}
static void __inline ShutdownAndStopWatcher(void)
{
- HANDLE hDoneEvent;
- hDoneEvent=CreateEvent(NULL,FALSE,FALSE,NULL);
- if (CallFunctionAsync(MainThreadMapping, &hDoneEvent))
- if (hDoneEvent != NULL) WaitForSingleObject(hDoneEvent,INFINITE);
- if (hDoneEvent != NULL) CloseHandle(hDoneEvent);
+ HANDLE hDoneEvent = CreateEvent(NULL,FALSE,FALSE,NULL);
+ CallFunctionAsync(MainThreadMapping, &hDoneEvent);
+ if (hDoneEvent != NULL) {
+ WaitForSingleObject(hDoneEvent,INFINITE);
+ CloseHandle(hDoneEvent);
+ }
}
/************************* Msg Shutdown *******************************/