Alexandria.AlexandriaManager.BackgroundOperationThreadStart C# (CSharp) Method

BackgroundOperationThreadStart() private method

private BackgroundOperationThreadStart ( ) : void
return void
        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);
            }
        }