From 6aeafa47b02b966067d3ff83453c9ae8f9b0fc70 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 11 Mar 2013 15:11:36 +0000 Subject: only a few real mir_forkthreadex survived git-svn-id: http://svn.miranda-ng.org/main/trunk@3977 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Clist_nicer/src/contact.cpp | 43 ++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 22 deletions(-) (limited to 'plugins/Clist_nicer/src/contact.cpp') diff --git a/plugins/Clist_nicer/src/contact.cpp b/plugins/Clist_nicer/src/contact.cpp index d4a0188164..672c10b3bb 100644 --- a/plugins/Clist_nicer/src/contact.cpp +++ b/plugins/Clist_nicer/src/contact.cpp @@ -114,29 +114,28 @@ static void MF_CalcFrequency(HANDLE hContact, DWORD dwCutoffDays, int doSleep) extern TCHAR g_ptszEventName[]; -DWORD WINAPI MF_UpdateThread(LPVOID p) +void MF_UpdateThread(LPVOID) { - HANDLE hContact; - HANDLE hEvent = OpenEvent(EVENT_ALL_ACCESS, FALSE, g_ptszEventName); - - WaitForSingleObject(hEvent, 20000); - ResetEvent(hEvent); - - while(mf_updatethread_running) { - hContact = db_find_first(); - while (hContact != NULL && mf_updatethread_running) { - MF_CalcFrequency(hContact, 50, 1); - if (mf_updatethread_running) - WaitForSingleObject(hEvent, 5000); - ResetEvent(hEvent); - hContact = db_find_next(hContact); - } - if (mf_updatethread_running) - WaitForSingleObject(hEvent, 1000000); - ResetEvent(hEvent); - } - CloseHandle(hEvent); - return 0; + HANDLE hContact; + HANDLE hEvent = OpenEvent(EVENT_ALL_ACCESS, FALSE, g_ptszEventName); + + WaitForSingleObject(hEvent, 20000); + ResetEvent(hEvent); + + while(mf_updatethread_running) { + hContact = db_find_first(); + while (hContact != NULL && mf_updatethread_running) { + MF_CalcFrequency(hContact, 50, 1); + if (mf_updatethread_running) + WaitForSingleObject(hEvent, 5000); + ResetEvent(hEvent); + hContact = db_find_next(hContact); + } + if (mf_updatethread_running) + WaitForSingleObject(hEvent, 1000000); + ResetEvent(hEvent); + } + CloseHandle(hEvent); } static BOOL mc_hgh_removed = FALSE; -- cgit v1.2.3