summaryrefslogtreecommitdiff
path: root/plugins/HistoryStats/src/statistic.cpp
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2015-05-11 14:35:53 +0000
committerKirill Volinsky <mataes2007@gmail.com>2015-05-11 14:35:53 +0000
commit8bfb11ba69d6c35961e8881f7b88d2f7b26c0622 (patch)
treeea92c2cd1ee59aa263ecb1cd768090b4502cc0df /plugins/HistoryStats/src/statistic.cpp
parentd978a71c913c7213158d7014e43fe6535c60dcc9 (diff)
minus CreateThread
git-svn-id: http://svn.miranda-ng.org/main/trunk@13534 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/HistoryStats/src/statistic.cpp')
-rw-r--r--plugins/HistoryStats/src/statistic.cpp15
1 files changed, 5 insertions, 10 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)