For now, just interrupt since its better than NOP.

This commit is contained in:
Thomas Suckow
2021-04-03 20:54:47 -07:00
parent 0f675bc4a9
commit 898193fcef
5 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -115,7 +115,7 @@ namespace Duplicati.CommandLine
if (m_thread != null && m_thread.IsAlive)
{
m_thread.Abort();
m_thread.Interrupt();
m_thread.Join(500);
}
}
@@ -211,11 +211,11 @@ namespace Duplicati.GUI.TrayIcon
{
m_shutdown = true;
m_waitLock.Set();
m_pollThread.Abort();
m_pollThread.Interrupt();
m_pollThread.Join(TimeSpan.FromSeconds(10));
if (!m_requestThread.Join(TimeSpan.FromSeconds(10)))
{
m_requestThread.Abort();
m_requestThread.Interrupt();
m_requestThread.Join(TimeSpan.FromSeconds(10));
}
}
+2 -2
View File
@@ -400,7 +400,7 @@ namespace Duplicati.Library.Main
if (m_taskControl != null)
m_taskControl.StateChangedEvent += (state) => {
if (state == TaskControlState.Abort)
m_thread.Abort();
m_thread.Interrupt();
};
m_queue = new BlockingQueue<FileEntryItem>(options.SynchronousUpload ? 1 : (options.AsynchronousUploadLimit == 0 ? int.MaxValue : options.AsynchronousUploadLimit));
m_thread = new System.Threading.Thread(this.ThreadRun);
@@ -1459,7 +1459,7 @@ namespace Duplicati.Library.Main
{
if (!m_thread.Join(TimeSpan.FromSeconds(10)))
{
m_thread.Abort();
m_thread.Interrupt();
m_thread.Join(TimeSpan.FromSeconds(10));
}
+1 -1
View File
@@ -496,7 +496,7 @@ namespace Duplicati.Library.Main
// If we are aborted, throw exception
if (m_controlState == TaskControlState.Abort)
{
System.Threading.Thread.CurrentThread.Abort();
System.Threading.Thread.CurrentThread.Interrupt();
// For some reason, aborting the current thread does not always throw an exception
throw new CancelException();
+1 -1
View File
@@ -232,7 +232,7 @@ namespace Duplicati.Library.Utility
{
try
{
m_thread.Abort();
m_thread.Interrupt();
m_thread.Join(500);
}
catch