mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-16 13:15:03 +00:00
closes #671 and changes to aborting thread in Dispose instead of attempting to join
This commit is contained in:
@@ -150,13 +150,13 @@ namespace PepperDash.Essentials.Core.Queues
|
|||||||
_delayEnabled = pacing > 0;
|
_delayEnabled = pacing > 0;
|
||||||
_delayTime = pacing;
|
_delayTime = pacing;
|
||||||
|
|
||||||
//CrestronEnvironment.ProgramStatusEventHandler += programEvent =>
|
CrestronEnvironment.ProgramStatusEventHandler += programEvent =>
|
||||||
//{
|
{
|
||||||
// if (programEvent != eProgramStatusEventType.Stopping)
|
if (programEvent != eProgramStatusEventType.Stopping)
|
||||||
// return;
|
return;
|
||||||
|
|
||||||
// Dispose(true);
|
Dispose(true);
|
||||||
//};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -232,9 +232,12 @@ namespace PepperDash.Essentials.Core.Queues
|
|||||||
if (disposing)
|
if (disposing)
|
||||||
{
|
{
|
||||||
Debug.Console(2, this, "Disposing...");
|
Debug.Console(2, this, "Disposing...");
|
||||||
|
if (_queue != null && !_queue.Disposed)
|
||||||
|
{
|
||||||
_queue.Clear();
|
_queue.Clear();
|
||||||
Enqueue(null);
|
Enqueue(null);
|
||||||
_worker.Join();
|
}
|
||||||
|
_worker.Abort();
|
||||||
_waitHandle.Close();
|
_waitHandle.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -243,7 +246,7 @@ namespace PepperDash.Essentials.Core.Queues
|
|||||||
|
|
||||||
~GenericQueue()
|
~GenericQueue()
|
||||||
{
|
{
|
||||||
Dispose(false);
|
Dispose(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -404,13 +407,13 @@ namespace PepperDash_Essentials_Core.Queues
|
|||||||
_delayEnabled = pacing > 0;
|
_delayEnabled = pacing > 0;
|
||||||
_delayTime = pacing;
|
_delayTime = pacing;
|
||||||
|
|
||||||
//CrestronEnvironment.ProgramStatusEventHandler += programEvent =>
|
CrestronEnvironment.ProgramStatusEventHandler += programEvent =>
|
||||||
//{
|
{
|
||||||
// if (programEvent != eProgramStatusEventType.Stopping)
|
if (programEvent != eProgramStatusEventType.Stopping)
|
||||||
// return;
|
return;
|
||||||
|
|
||||||
// Dispose(true);
|
Dispose(true);
|
||||||
//};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -480,9 +483,12 @@ namespace PepperDash_Essentials_Core.Queues
|
|||||||
if (disposing)
|
if (disposing)
|
||||||
{
|
{
|
||||||
Debug.Console(2, this, "Disposing...");
|
Debug.Console(2, this, "Disposing...");
|
||||||
|
if (_queue != null && !_queue.Disposed)
|
||||||
|
{
|
||||||
_queue.Clear();
|
_queue.Clear();
|
||||||
Enqueue(null);
|
Enqueue(null);
|
||||||
_worker.Join();
|
}
|
||||||
|
_worker.Abort();
|
||||||
_waitHandle.Close();
|
_waitHandle.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -491,7 +497,7 @@ namespace PepperDash_Essentials_Core.Queues
|
|||||||
|
|
||||||
~GenericQueue()
|
~GenericQueue()
|
||||||
{
|
{
|
||||||
Dispose(false);
|
Dispose(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user