private static void RaiseCollected() { var check = Volatile.Read(ref _status); if (check == _statusReady) { try { _collectedEventHandlers.RemoveDeadItems(); _collectedEventHandlers.Invoke(null, new EventArgs()); } catch (Exception exception) { // Catch'em all GC.KeepAlive(exception); } Volatile.Write(ref _status, _statusReady); } }
private static void RaiseCollected() { var check = Thread.VolatileRead(ref _status); if (check == INT_StatusReady) { try { _collectedEventHandlers.RemoveDeadItems(); _collectedEventHandlers.Invoke(null, new EventArgs()); } catch (Exception exception) { // Pokemon GC.KeepAlive(exception); } Thread.VolatileWrite(ref _status, INT_StatusReady); } }
public void Invoke(Action <TDelegate> invokeAction) { delegates.Invoke(invokeAction); }