summaryrefslogtreecommitdiff
path: root/plugins/AutoShutdown/src/cpuusage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/AutoShutdown/src/cpuusage.cpp')
-rw-r--r--plugins/AutoShutdown/src/cpuusage.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/plugins/AutoShutdown/src/cpuusage.cpp b/plugins/AutoShutdown/src/cpuusage.cpp
index 2959013407..25eb542f35 100644
--- a/plugins/AutoShutdown/src/cpuusage.cpp
+++ b/plugins/AutoShutdown/src/cpuusage.cpp
@@ -72,10 +72,8 @@ static BOOL CallBackAndWait(struct CpuUsageThreadParams *param, BYTE nCpuUsage)
return !Miranda_IsTerminated();
}
-static void WinNT_PollThread(void *vparam)
+static void WinNT_PollThread(CpuUsageThreadParams *param)
{
- CpuUsageThreadParams *param = (CpuUsageThreadParams*)vparam;
-
DWORD dwBufferSize = 0, dwCount;
BYTE *pBuffer = nullptr;
PERF_DATA_BLOCK *pPerfData = nullptr;
@@ -204,7 +202,7 @@ DWORD PollCpuUsage(CPUUSAGEAVAILPROC pfnDataAvailProc, LPARAM lParam, DWORD dwDe
param->hFirstEvent = hFirstEvent;
/* start thread */
- if (mir_forkthread(WinNT_PollThread, param) != INVALID_HANDLE_VALUE)
+ if (mir_forkThread<CpuUsageThreadParams>(WinNT_PollThread, param) != INVALID_HANDLE_VALUE)
WaitForSingleObject(hFirstEvent, INFINITE); /* wait for first success */
else
mir_free(param); /* thread not started */