From 4743852466b8393bdcbb88ef9b33d13305f26038 Mon Sep 17 00:00:00 2001 From: Aaron Franke Date: Thu, 6 Sep 2018 21:08:16 -0400 Subject: [Mono] Tabs -> Spaces --- modules/mono/glue/cs_files/GodotTaskScheduler.cs | 148 +++++++++++------------ 1 file changed, 74 insertions(+), 74 deletions(-) (limited to 'modules/mono/glue/cs_files/GodotTaskScheduler.cs') diff --git a/modules/mono/glue/cs_files/GodotTaskScheduler.cs b/modules/mono/glue/cs_files/GodotTaskScheduler.cs index 3d23ec10f1..9a40fef5a9 100644 --- a/modules/mono/glue/cs_files/GodotTaskScheduler.cs +++ b/modules/mono/glue/cs_files/GodotTaskScheduler.cs @@ -6,89 +6,89 @@ using System.Threading.Tasks; namespace Godot { - public class GodotTaskScheduler : TaskScheduler - { - private GodotSynchronizationContext Context { get; set; } - private readonly LinkedList _tasks = new LinkedList(); + public class GodotTaskScheduler : TaskScheduler + { + private GodotSynchronizationContext Context { get; set; } + private readonly LinkedList _tasks = new LinkedList(); - public GodotTaskScheduler() - { - Context = new GodotSynchronizationContext(); - SynchronizationContext.SetSynchronizationContext(Context); - } + public GodotTaskScheduler() + { + Context = new GodotSynchronizationContext(); + SynchronizationContext.SetSynchronizationContext(Context); + } - protected sealed override void QueueTask(Task task) - { - lock (_tasks) - { - _tasks.AddLast(task); - } - } + protected sealed override void QueueTask(Task task) + { + lock (_tasks) + { + _tasks.AddLast(task); + } + } - protected sealed override bool TryExecuteTaskInline(Task task, bool taskWasPreviouslyQueued) - { - if (SynchronizationContext.Current != Context) - { - return false; - } + protected sealed override bool TryExecuteTaskInline(Task task, bool taskWasPreviouslyQueued) + { + if (SynchronizationContext.Current != Context) + { + return false; + } - if (taskWasPreviouslyQueued) - { - TryDequeue(task); - } + if (taskWasPreviouslyQueued) + { + TryDequeue(task); + } - return TryExecuteTask(task); - } + return TryExecuteTask(task); + } - protected sealed override bool TryDequeue(Task task) - { - lock (_tasks) - { - return _tasks.Remove(task); - } - } + protected sealed override bool TryDequeue(Task task) + { + lock (_tasks) + { + return _tasks.Remove(task); + } + } - protected sealed override IEnumerable GetScheduledTasks() - { - lock (_tasks) - { - return _tasks.ToArray(); - } - } + protected sealed override IEnumerable GetScheduledTasks() + { + lock (_tasks) + { + return _tasks.ToArray(); + } + } - public void Activate() - { - ExecuteQueuedTasks(); - Context.ExecutePendingContinuations(); - } + public void Activate() + { + ExecuteQueuedTasks(); + Context.ExecutePendingContinuations(); + } - private void ExecuteQueuedTasks() - { - while (true) - { - Task task; + private void ExecuteQueuedTasks() + { + while (true) + { + Task task; - lock (_tasks) - { - if (_tasks.Any()) - { - task = _tasks.First.Value; - _tasks.RemoveFirst(); - } - else - { - break; - } - } + lock (_tasks) + { + if (_tasks.Any()) + { + task = _tasks.First.Value; + _tasks.RemoveFirst(); + } + else + { + break; + } + } - if (task != null) - { - if (!TryExecuteTask(task)) - { - throw new InvalidOperationException(); - } - } - } - } - } + if (task != null) + { + if (!TryExecuteTask(task)) + { + throw new InvalidOperationException(); + } + } + } + } + } } -- cgit v1.2.3