diff --git a/IPA.Loader/Utilities/Async/SingleThreadTaskScheduler.cs b/IPA.Loader/Utilities/Async/SingleThreadTaskScheduler.cs index 605e1dc6..85cced15 100644 --- a/IPA.Loader/Utilities/Async/SingleThreadTaskScheduler.cs +++ b/IPA.Loader/Utilities/Async/SingleThreadTaskScheduler.cs @@ -17,15 +17,28 @@ namespace IPA.Utilities.Async private readonly BlockingCollection tasks = new BlockingCollection(); private readonly CancellationTokenSource exitTokenSource = new CancellationTokenSource(); + /// + /// Gets whether or not the underlying thread has been started. + /// + /// Thrown if this object has already been disposed. + public bool IsRunning + { + get + { + ThrowIfDisposed(); + return runThread.IsAlive; + } + } + /// /// Starts the thread that executes tasks scheduled with this /// /// Thrown if this object has already been disposed. - public void StartThread() + public void Start() { ThrowIfDisposed(); - runThread.Start(); + runThread.Start(this); } /// @@ -47,7 +60,6 @@ namespace IPA.Utilities.Async var retTasks = new List(); retTasks.AddRange(tasks); - Dispose(true); return retTasks; } @@ -64,7 +76,6 @@ namespace IPA.Utilities.Async tasks.CompleteAdding(); runThread.Join(); - Dispose(true); } ///