diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2015-05-11 14:35:53 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2015-05-11 14:35:53 +0000 |
commit | 8bfb11ba69d6c35961e8881f7b88d2f7b26c0622 (patch) | |
tree | ea92c2cd1ee59aa263ecb1cd768090b4502cc0df /plugins/HistoryStats/src | |
parent | d978a71c913c7213158d7014e43fe6535c60dcc9 (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')
-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();
|