Catrobat.Core.Services.Common.SaveHandler.Execute C# (CSharp) 메소드

Execute() 공개 정적인 메소드

public static Execute ( ) : void
리턴 void
        public static async void Execute()
        {
            while (true)
            {
                while (_saveJobQueue != null && _saveJobQueue.Count > 0)
                {
                    SaveJob actualJob;

                    lock (QueueLock)
                    {
                        actualJob = _saveJobQueue.Dequeue();
                    }

                    try
                    {
                        await actualJob.ProgramToSave.Save();
                    }
                    catch(Exception e)
                    {
                        Debug.WriteLine("Could not Save, Exception: " + e.Message);
                        continue;
                    }
                }

                // To ensure that the thread will do all savejobs left before stopping
                if (!running)
                    break;

                waitHandle.WaitOne();
                waitHandle.Reset();
            }
        }