For now, just interrupt since its better than NOP.
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -232,7 +232,7 @@ namespace Duplicati.Library.Utility
|
||||
{
|
||||
try
|
||||
{
|
||||
m_thread.Abort();
|
||||
m_thread.Interrupt();
|
||||
m_thread.Join(500);
|
||||
}
|
||||
catch
|
||||
|
||||
Reference in New Issue
Block a user