mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-04-14 04:57:15 +00:00
closes #671 and changes to aborting thread in Dispose instead of attempting to join
This commit is contained in:
parent
2feec62052
commit
200080247a
1 changed files with 30 additions and 24 deletions
|
|
@ -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>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue