Example #1
0
        public static void Subscribe(CallSlot call)
        {
            var bucket = s_Calls[(call.GetHashCode() & CoreConsts.ABS_HASH_MASK) % BUCKETS];

            lock (bucket) bucket.AddLast(call);
            if (s_Thread == null)
            {
                lock (typeof(TimeoutReactor))
                    if (s_Thread == null)
                    {
                        s_Thread = new Thread(threadSpin);
                        s_Thread.IsBackground = true;
                        s_Thread.Name         = typeof(TimeoutReactor).FullName;
                        s_Thread.Start();
                    }
            }
        }
Example #2
0
        public static void Subscribe(CallSlot call)
        {
            var bucket = s_Calls[Math.Abs(call.GetHashCode() % BUCKETS)];

            lock (bucket) bucket.Add(call);
            if (s_Thread == null)
            {
                lock (typeof(TimeoutReactor))
                    if (s_Thread == null)
                    {
                        s_Thread = new Thread(threadSpin);
                        s_Thread.IsBackground = true;
                        s_Thread.Name         = typeof(TimeoutReactor).FullName;
                        s_Thread.Start();
                    }
            }
        }