void BackgroundOperationThreadStart() { while (true) { lock (BackgroundOperations) { if (BackgroundOperations.Count > 0) { CurrentBackgroundOperation = BackgroundOperations[0]; BackgroundOperations.RemoveAt(0); try { CurrentBackgroundOperation.Run(BackgroundOperationUpdateProgress); } catch (Exception exception) { Debugger.Log(0, "Exception", exception.ToString()); if (DebuggingEnabled) { Debugger.Break(); } } BackgroundOperationProgress = 0; CurrentBackgroundOperation = null; } } Thread.Sleep(100); } }