summaryrefslogtreecommitdiff
path: root/plugins/AutoShutdown/src/cpuusage.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-05-03 16:02:14 +0200
committerGeorge Hazan <ghazan@miranda.im>2018-05-03 16:02:14 +0200
commit3ad2582c4a4a6378f294f9256ecbcbdf0ae88e3a (patch)
tree412a28ef6a572efc7039df1c363bf47a3dec4b19 /plugins/AutoShutdown/src/cpuusage.cpp
parent9a6f750a482d1d1ebf4281bb7bf8133e547ad438 (diff)
mir_forkThread<typename> - stronger typizatioin for thread function parameter
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 */