From 22f6f8cf6d902b7460d727aa894d9df68e1bab1c Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 4 Mar 2019 13:09:22 +0300 Subject: PluginUpdater: unused thread removed --- plugins/PluginUpdater/src/DlgUpdate.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'plugins/PluginUpdater/src/DlgUpdate.cpp') diff --git a/plugins/PluginUpdater/src/DlgUpdate.cpp b/plugins/PluginUpdater/src/DlgUpdate.cpp index b8b9737b10..0b75c21b90 100644 --- a/plugins/PluginUpdater/src/DlgUpdate.cpp +++ b/plugins/PluginUpdater/src/DlgUpdate.cpp @@ -368,7 +368,7 @@ static INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM g_plugin.setDword(DB_SETTING_LAST_UPDATE, time(0)); - mir_forkthread(InitTimer); + InitTimer(0); break; } @@ -794,7 +794,7 @@ static void CheckUpdates(void *) else CallFunctionAsync(LaunchDialog, UpdateFiles); } - mir_forkthread(InitTimer, (success ? nullptr : (void*)2)); + CallFunctionAsync(InitTimer, (success ? nullptr : (void*)2)); hashes.destroy(); hCheckThread = nullptr; @@ -889,7 +889,6 @@ void InitTimer(void *type) { if (!opts.bUpdateOnPeriod) return; - Thread_SetName("PluginUpdater: InitTimer"); LONGLONG interval; @@ -922,12 +921,10 @@ void InitTimer(void *type) li.HighPart = ft.dwHighDateTime; li.QuadPart += interval * 10000LL; SetWaitableTimer(hTimer, &li, 0, TimerAPCProc, nullptr, 0); - - // Wait in an alertable state for the timer to go off. - SleepEx(INFINITE, TRUE); } -void CreateTimer() { +void CreateTimer() +{ hTimer = CreateWaitableTimer(nullptr, FALSE, nullptr); - mir_forkthread(InitTimer); + InitTimer(0); } -- cgit v1.2.3