public static void RemoveService (dLightWeightProcessBase _Process) { if (m_Processes != null) { if (m_Processes.Remove (_Process)) { _Process.internal_DecrementRegister (); Command command = new Command (eCommandType.UnRegister, _Process); ThreadProcess.EnqueueCommand (command); command.Event.WaitOne (); } } }
public Command (eCommandType _Command, dLightWeightProcessBase _Service) { m_Command = _Command; m_Service = _Service; m_Event = new ManualResetEvent (false); }
public static void AddService (dLightWeightProcessBase _Process) { if (m_Processes != null) { if (_Process != null) { m_Processes.Add (_Process); _Process.internal_IncrementRegister (); Command command = new Command (eCommandType.Register, _Process); ThreadProcess.EnqueueCommand (command); command.Event.WaitOne (); } } else { throw new Exception ("dLightWeightProcessThread has not been initialised, please initialise it through the Foundation Initialisation System."); } }
public static void AsyncRemoveService (dLightWeightProcessBase _Process) { if (m_Processes != null) { if (m_Processes.Remove (_Process)) { _Process.internal_DecrementRegister (); ThreadProcess.EnqueueCommand (new Command (eCommandType.UnRegister, _Process)); } } }
private void RemoveServiceFromList (dLightWeightProcessBase _process) { _process.internal_UnRegister (); }
private void AddServiceToList (dLightWeightProcessBase _process) { _process.internal_Register (EnqueueProcessToBeUpdated); }
public static void EnqueueProcessToBeUpdated (dLightWeightProcessBase _process) { if (Active) { if (_process.PendingProcessCount == 0 && _process.RegestrationCount > 0) { Command command = new Command (eCommandType.process, _process); m_InternalCommandQueue.Enqueue (command); m_InternalCommandQueueEvent.Release (); } } }