Catrobat.Core.Services.Common.SaveHandler.addSaveJob C# (CSharp) Method

addSaveJob() public static method

public static addSaveJob ( System.Program toSave ) : void
toSave System.Program
return void
        public static void addSaveJob(Program toSave)
        {
            SaveJob newJob = new SaveJob();
            newJob.ProgramToSave = toSave;

            lock (QueueLock)
            {
                if (!_saveJobQueue.Contains(newJob))
                _saveJobQueue.Enqueue(newJob);
            }

            // Wake up the Saving Task
            waitHandle.Set();
        }