diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2012-07-03 17:22:40 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2012-07-03 17:22:40 +0000 |
commit | ad4e888349c2d220828c93d2d50635ff23a6fc72 (patch) | |
tree | faec91eff1839928805c2fbfe6d04b37723dc028 /plugins/AutoShutdown/watcher.cpp | |
parent | 49566229022ee6e96eac0888f9c0501fcd92033b (diff) |
AutoShutdown:
plusified
git-svn-id: http://svn.miranda-ng.org/main/trunk@737 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/AutoShutdown/watcher.cpp')
-rw-r--r-- | plugins/AutoShutdown/watcher.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/AutoShutdown/watcher.cpp b/plugins/AutoShutdown/watcher.cpp index 75a2881e98..ad9422e439 100644 --- a/plugins/AutoShutdown/watcher.cpp +++ b/plugins/AutoShutdown/watcher.cpp @@ -43,8 +43,9 @@ static HANDLE hHookModulesLoaded; static WORD currentWatcherType;
-static void __stdcall MainThreadMapping(HANDLE *phDoneEvent)
+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);
@@ -54,7 +55,7 @@ static void __inline ShutdownAndStopWatcher(void) {
HANDLE hDoneEvent;
hDoneEvent=CreateEvent(NULL,FALSE,FALSE,NULL);
- if(CallFunctionAsync(MainThreadMapping,&hDoneEvent))
+ if(CallFunctionAsync(MainThreadMapping, &hDoneEvent))
if(hDoneEvent!=NULL) WaitForSingleObject(hDoneEvent,INFINITE);
if(hDoneEvent!=NULL) CloseHandle(hDoneEvent);
}
|