// Token: 0x060075E9 RID: 30185 RVA: 0x00183DB8 File Offset: 0x00181FB8
        public bool UnsubscribeFromHealthNotifications(Guid registrationKey)
        {
            if (registrationKey == Guid.Empty)
            {
                throw new ArgumentException("Guid.Empty is never an acceptable registration key", "registrationKey");
            }
            bool flag = false;

            lock (this.instanceLock)
            {
                if (this.notificationCount > 0)
                {
                    for (int i = this.notifications.Count - 1; i >= 0; i--)
                    {
                        CacheableResourceHealthMonitor.NotificationWrapper notificationWrapper = this.notifications[i];
                        if (notificationWrapper.Key == registrationKey)
                        {
                            this.notifications.RemoveAt(i);
                            this.notificationCount--;
                            flag = true;
                            break;
                        }
                    }
                }
            }
            ExTraceGlobals.ResourceHealthManagerTracer.TraceDebug <ResourceKey, Guid, bool>((long)this.GetHashCode(), "[CacheableResourceHealthMonitor.UnsubscribeFromHealthNotifications] Unregistered for Resource Key: '{0}', Guid: '{1}', Found? {2}", this.Key, registrationKey, flag);
            return(flag);
        }
        // Token: 0x060075E8 RID: 30184 RVA: 0x00183D14 File Offset: 0x00181F14
        public Guid SubscribeToHealthNotifications(WorkloadClassification classification, HealthRecoveryNotification delegateToFire)
        {
            if (delegateToFire == null)
            {
                throw new ArgumentNullException("delegateToFire");
            }
            if (classification == WorkloadClassification.Unknown)
            {
                throw new ArgumentException("You cannot use Unknown to register for health change notifications.", "classification");
            }
            ExTraceGlobals.ResourceHealthManagerTracer.TraceDebug <ResourceKey, WorkloadClassification>((long)this.GetHashCode(), "[CacheableResourceHealthMonitor.SubscribeToHealthNotifications] Registration was made for resource '{0}', classification: {1}.", this.Key, classification);
            Guid key;

            lock (this.instanceLock)
            {
                CacheableResourceHealthMonitor.NotificationWrapper notificationWrapper = new CacheableResourceHealthMonitor.NotificationWrapper(classification, delegateToFire);
                this.notifications.Add(notificationWrapper);
                this.notificationCount++;
                key = notificationWrapper.Key;
            }
            return(key);
        }
        // Token: 0x060075EB RID: 30187 RVA: 0x00183E94 File Offset: 0x00182094
        internal int FireNotifications()
        {
            int num = 0;
            List <CacheableResourceHealthMonitor.NotificationWrapper> list = null;

            if (CacheableResourceHealthMonitor.NotificationCheckFrequency == TimeSpan.Zero || TimeProvider.UtcNow - this.lastNotificationCheckUtc >= CacheableResourceHealthMonitor.NotificationCheckFrequency)
            {
                lock (this.instanceLock)
                {
                    if (CacheableResourceHealthMonitor.NotificationCheckFrequency == TimeSpan.Zero || TimeProvider.UtcNow - this.lastNotificationCheckUtc >= CacheableResourceHealthMonitor.NotificationCheckFrequency)
                    {
                        for (int i = this.notifications.Count - 1; i >= 0; i--)
                        {
                            CacheableResourceHealthMonitor.NotificationWrapper notificationWrapper = this.notifications[i];
                            if (this.GetResourceLoad(notificationWrapper.Classification, false, null).State == ResourceLoadState.Underloaded)
                            {
                                if (list == null)
                                {
                                    list = new List <CacheableResourceHealthMonitor.NotificationWrapper>();
                                }
                                list.Add(notificationWrapper);
                                this.notificationCount--;
                                num++;
                                this.notifications.RemoveAt(i);
                            }
                        }
                    }
                    this.lastNotificationCheckUtc = TimeProvider.UtcNow;
                }
            }
            if (list != null)
            {
                this.FireNotificationsAsync(list);
                ExTraceGlobals.ResourceHealthManagerTracer.TraceDebug <int, ResourceKey>((long)this.GetHashCode(), "[CacheableResourceHealthMonitor.FireNotifications] Firing off {0} notifications for resource '{1}'", num, this.Key);
            }
            return(num);
        }