Removed some Shutdown/Terminate functions in favor of Dispose

This commit is contained in:
Justin Swanson 2019-12-06 20:04:42 -06:00
parent 179ac2b0ee
commit 03c88b0f38
5 changed files with 5 additions and 22 deletions

View File

@ -85,15 +85,10 @@ namespace Wabbajack.Common
Queue.Add(a);
}
public void Shutdown()
public void Dispose()
{
_cancel.Cancel();
Threads.Do(th => th.Join());
}
public void Dispose()
{
Shutdown();
Queue?.Dispose();
}
}

View File

@ -12,11 +12,6 @@ namespace Wabbajack.Lib
{
public WorkQueue Queue { get; private set; }
public void Dispose()
{
Queue?.Shutdown();
}
public Context VFS { get; private set; }
protected StatusUpdateTracker UpdateTracker { get; private set; }
@ -109,10 +104,10 @@ namespace Wabbajack.Lib
return _tcs.Task;
}
public void Terminate()
public void Dispose()
{
_cancel.Cancel();
Queue?.Shutdown();
Queue?.Dispose();
_isRunning.OnNext(false);
}
}

View File

@ -36,12 +36,5 @@ namespace Wabbajack.Lib
/// Begin processing
/// </summary>
Task<bool> Begin();
/// <summary>
/// Terminate any processing currently in progress by the processor. The processor should be disposed of
/// after calling this function as processing cannot be resumed and the tasks may be half completed.
/// Should only be called while IsRunning = true;
/// </summary>
void Terminate();
}
}

View File

@ -34,7 +34,7 @@ namespace Wabbajack.Test.ListValidation
[TestCleanup]
public void Cleanup()
{
Queue.Shutdown();
Queue.Dispose();
Queue = null;
}

View File

@ -39,7 +39,7 @@ namespace Wabbajack.Test
[TestCleanup]
public void Cleanup()
{
Queue.Shutdown();
Queue.Dispose();
}
[TestMethod]