Beispiel #1
0
        private static void UnregisterEventQ(RedisEventQueue eventQ)
        {
            if ((eventQ != null) && eventQ.m_Registered)
            {
                lock (s_EventQRegistryLock)
                {
                    if (eventQ.m_Registered)
                    {
                        try
                        {
                            eventQ.m_Registered = false;

                            s_EventQRegistry.Remove(eventQ);
                            if (s_EventQRegistry.Count == 0)
                            {
                                var cts = Interlocked.Exchange(ref s_CancelationTokenSource, null);
                                if (cts != null)
                                {
                                    cts.Cancel();
                                }
                            }
                        }
                        finally
                        {
                            Monitor.PulseAll(s_EventQRegistryLock);
                        }
                    }
                }
            }
        }
Beispiel #2
0
 private static void RegisterEventQ(RedisEventQueue eventQ)
 {
     if ((eventQ != null) && !eventQ.m_Registered)
     {
         lock (s_EventQRegistryLock)
         {
             if (!eventQ.m_Registered)
             {
                 try
                 {
                     eventQ.m_Registered = true;
                     s_EventQRegistry.Add(eventQ);
                 }
                 finally
                 {
                     Monitor.PulseAll(s_EventQRegistryLock);
                 }
             }
         }
     }
 }
Beispiel #3
0
 public ManagerEvent(RedisEventQueue eventQ, Action <object> action, object state)
 {
     m_Action = action;
     m_EventQ = eventQ;
     m_State  = state;
 }