private void ApplyProc() { var wh = new WaitHandle[] { _evExit, _evGotNotification }; while (true) { IRepositoryChangedNotification notification = null; lock (_pendingNotifications) { if (_pendingNotifications.Count != 0) { notification = _pendingNotifications.Dequeue(); } } if (notification == null) { if (WaitHandle.WaitAny(wh) == 0) { return; } continue; } try { notification.Apply(_repository); } catch { } } }
private void EmitDelayedNotification(IRepositoryChangedNotification notification) { lock (_delayedNotifications) { _delayedNotifications.Enqueue(notification); } _evGotDelayedNotification.Set(); }
private void EmitNotification(IRepositoryChangedNotification notification) { lock (_pendingNotifications) { _pendingNotifications.Enqueue(notification); } _evGotNotification.Set(); }
private void EmitNotification(IRepositoryChangedNotification notification) { lock(_pendingNotifications) { _pendingNotifications.Enqueue(notification); } _evGotNotification.Set(); }
private void EmitDelayedNotification(IRepositoryChangedNotification notification) { lock(_delayedNotifications) { _delayedNotifications.Enqueue(notification); } _evGotDelayedNotification.Set(); }