diff options
author | George Hazan <ghazan@miranda.im> | 2019-03-04 13:09:22 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-03-04 13:09:22 +0300 |
commit | 22f6f8cf6d902b7460d727aa894d9df68e1bab1c (patch) | |
tree | 9301f5ba1b09e75467079b93deaea68ffc98d8f1 /plugins/PluginUpdater/src/DlgUpdate.cpp | |
parent | ec99c7538e249e839676052d6cd16f8927b7fcb6 (diff) |
PluginUpdater: unused thread removed
Diffstat (limited to 'plugins/PluginUpdater/src/DlgUpdate.cpp')
-rw-r--r-- | plugins/PluginUpdater/src/DlgUpdate.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
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);
}
|