Fix bug where multiple threads modify same variable at the same time. Perform some refactoring
This commit is contained in:
@@ -65,8 +65,8 @@ namespace ProgramLib
|
||||
try
|
||||
{
|
||||
Dictionary<Events, EventWaitHandle> eventDict = new Dictionary<Events, EventWaitHandle>();
|
||||
eventDict[Events.GLOBAL_QUIT] = Program.Instance()._eventManager[EventManager.Events.GLOBAL_QUIT];
|
||||
eventDict[Events.FATAL_FAILURE] = Program.Instance()._eventManager[EventManager.Events.FATAL_FAILURE];
|
||||
eventDict[Events.GLOBAL_QUIT] = Program.Instance().EventManager[EventManager.Events.GLOBAL_QUIT];
|
||||
eventDict[Events.FATAL_FAILURE] = Program.Instance().EventManager[EventManager.Events.FATAL_FAILURE];
|
||||
eventDict[Events.EVENT_TIMED_OUT] = null;
|
||||
|
||||
EventGroup<Events, EventWaitHandle> eventGroup = new EventGroup<Events, EventWaitHandle>(eventDict);
|
||||
@@ -75,7 +75,7 @@ namespace ProgramLib
|
||||
|
||||
if (id == Events.FATAL_FAILURE)
|
||||
{
|
||||
Program.Instance()._eventManager[EventManager.Events.GLOBAL_QUIT].Set();
|
||||
Program.Instance().EventManager[EventManager.Events.GLOBAL_QUIT].Set();
|
||||
|
||||
UutPowerAction uutPowerAction = new UutPowerAction();
|
||||
uutPowerAction.UutPowerOff();
|
||||
|
||||
Reference in New Issue
Block a user