From bab358398a38726d29e04cb1f3accdd0d5bbdf57 Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Fri, 2 Sep 2011 22:30:18 -0700 Subject: [PATCH] potential fix for "Execution lock has fucked up" --- NzbDrone.Core/Providers/Jobs/JobProvider.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/NzbDrone.Core/Providers/Jobs/JobProvider.cs b/NzbDrone.Core/Providers/Jobs/JobProvider.cs index 11a8b02ac..362abcf4a 100644 --- a/NzbDrone.Core/Providers/Jobs/JobProvider.cs +++ b/NzbDrone.Core/Providers/Jobs/JobProvider.cs @@ -11,6 +11,7 @@ using NzbDrone.Core.Model; using NzbDrone.Core.Model.Notification; using NzbDrone.Core.Repository; using PetaPoco; +using ThreadState = System.Threading.ThreadState; namespace NzbDrone.Core.Providers.Jobs { @@ -161,7 +162,7 @@ namespace NzbDrone.Core.Providers.Jobs _isRunning = true; } - if (_jobThread == null || !_jobThread.IsAlive) + if (_jobThread == null || _jobThread.ThreadState != ThreadState.Running) { Logger.Trace("Initializing queue processor thread"); @@ -178,6 +179,8 @@ namespace NzbDrone.Core.Providers.Jobs finally { _isRunning = false; + _jobThread.Abort(); + } };