From 22bdcecfd4e4d222f9dc233ec1af033e8362b1dd Mon Sep 17 00:00:00 2001 From: Kenneth Skovhede Date: Sat, 28 Dec 2024 19:58:20 +0100 Subject: [PATCH] Fixed a minor race where the thread could start before the worker is initialized. (#5817) --- Duplicati/Library/RestAPI/Scheduler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Duplicati/Library/RestAPI/Scheduler.cs b/Duplicati/Library/RestAPI/Scheduler.cs index 91f102668..bbf5d6219 100644 --- a/Duplicati/Library/RestAPI/Scheduler.cs +++ b/Duplicati/Library/RestAPI/Scheduler.cs @@ -94,8 +94,8 @@ namespace Duplicati.Server /// The worker thread public void Init(WorkerThread worker) { - m_thread = new Thread(new ThreadStart(Runner)); m_worker = worker; + m_thread = new Thread(new ThreadStart(Runner)); m_worker.CompletedWork += OnCompleted; m_worker.StartingWork += OnStartingWork; m_schedule = new KeyValuePair[0];