diff Implab/AbstractEvent.cs @ 233:d6fe09f5592c v2

Improved AsyncQueue Removed ImplabFx
author cin
date Wed, 04 Oct 2017 15:44:47 +0300
parents 75103928da09
children fa6cbf4d8841
line wrap: on
line diff
--- a/Implab/AbstractEvent.cs	Tue Sep 12 19:07:42 2017 +0300
+++ b/Implab/AbstractEvent.cs	Wed Oct 04 15:44:47 2017 +0300
@@ -24,13 +24,13 @@
 
         //readonly THandler[] m_handlers = new THandler[RESERVED_HANDLERS_COUNT];
         THandler[] m_handlers;
-        MTQueue<THandler> m_extraHandlers;
+        SimpleAsyncQueue<THandler> m_extraHandlers;
         int m_handlerPointer = -1;
         int m_handlersCommited;
 
         int m_cancelRequest;
         Exception m_cancelationReason;
-        MTQueue<Action<Exception>> m_cancelationHandlers;
+        SimpleAsyncQueue<Action<Exception>> m_cancelationHandlers;
 
 
         #region state managment
@@ -182,7 +182,7 @@
                     }
                 } else {
                     if (slot == RESERVED_HANDLERS_COUNT) {
-                        m_extraHandlers = new MTQueue<THandler>();
+                        m_extraHandlers = new SimpleAsyncQueue<THandler>();
                     } else {
                         while (m_extraHandlers == null)
                             Thread.MemoryBarrier();
@@ -245,7 +245,7 @@
                 handler(CancellationReason);
 
             if (m_cancelationHandlers == null)
-                Interlocked.CompareExchange(ref m_cancelationHandlers, new MTQueue<Action<Exception>>(), null);
+                Interlocked.CompareExchange(ref m_cancelationHandlers, new SimpleAsyncQueue<Action<Exception>>(), null);
 
             m_cancelationHandlers.Enqueue(handler);