diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/HistoryStats/src/statistic.cpp | 15 | ||||
-rw-r--r-- | plugins/HistoryStats/src/statistic.h | 4 |
2 files changed, 7 insertions, 12 deletions
diff --git a/plugins/HistoryStats/src/statistic.cpp b/plugins/HistoryStats/src/statistic.cpp index d4590f5f9e..e609101d3d 100644 --- a/plugins/HistoryStats/src/statistic.cpp +++ b/plugins/HistoryStats/src/statistic.cpp @@ -1261,8 +1261,7 @@ bool Statistic::createStatistics() utils::centerDialog(m_hWndProgress);
UpdateWindow(m_hWndProgress);
- DWORD dwThreadID = 0;
- HANDLE hThread = CreateThread(NULL, 0, threadProcSteps, this, 0, &dwThreadID);
+ HANDLE hThread = mir_forkthread(threadProcSteps, (void*)this);
bool bDone = false;
MSG msg;
@@ -1370,7 +1369,7 @@ bool Statistic::createStatisticsSteps() return true;
}
-DWORD WINAPI Statistic::threadProc(LPVOID lpParameter)
+void __cdecl Statistic::threadProc(void *lpParameter)
{
Statistic* pStats = reinterpret_cast<Statistic*>(lpParameter);
@@ -1384,18 +1383,15 @@ DWORD WINAPI Statistic::threadProc(LPVOID lpParameter) delete pStats;
m_bRunning = false;
- return 0;
}
-DWORD WINAPI Statistic::threadProcSteps(LPVOID lpParameter)
+void __cdecl Statistic::threadProcSteps(void *lpParameter)
{
Statistic* pStats = reinterpret_cast<Statistic*>(lpParameter);
if (pStats->m_Settings.m_ThreadLowPriority)
SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_BELOW_NORMAL);
- bool bSuccess = pStats->createStatisticsSteps();
-
- return (bSuccess ? 0 : 1);
+ pStats->createStatisticsSteps();
}
INT_PTR CALLBACK Statistic::staticConflictProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
@@ -1485,8 +1481,7 @@ void Statistic::run(const Settings& settings, InvocationSource invokedFrom, HINS Statistic *pStats = new Statistic(settings, invokedFrom, hInst);
pStats->m_hThreadPushEvent = hEvent;
// create worker thread
- DWORD dwThreadID = 0;
- HANDLE hThread = CreateThread(NULL, 0, threadProc, pStats, 0, &dwThreadID);
+ HANDLE hThread = mir_forkthread(threadProc, (void*)pStats);
// wait for thread to place itself on thread unwind stack
if (hThread != NULL)
diff --git a/plugins/HistoryStats/src/statistic.h b/plugins/HistoryStats/src/statistic.h index e5ca7e6f4f..cc9e4e4546 100644 --- a/plugins/HistoryStats/src/statistic.h +++ b/plugins/HistoryStats/src/statistic.h @@ -160,8 +160,8 @@ private: explicit Statistic(const Settings& settings, InvocationSource invokedFrom, HINSTANCE hInst);
bool createStatistics();
bool createStatisticsSteps();
- static DWORD WINAPI threadProc(LPVOID lpParameter);
- static DWORD WINAPI threadProcSteps(LPVOID lpParameter);
+ static void __cdecl threadProc(void *lpParameter);
+ static void __cdecl threadProcSteps(void *lpParameter);
public:
~Statistic();
|