diff Implab/Parallels/MTQueue.cs @ 23:f0568ff069a5

Слияние с promises
author cin
date Wed, 13 Nov 2013 14:03:20 +0400
parents e3935fdf59a2
children ee04e1fa78da
line wrap: on
line diff
--- a/Implab/Parallels/MTQueue.cs	Fri Nov 08 01:27:04 2013 +0400
+++ b/Implab/Parallels/MTQueue.cs	Wed Nov 13 14:03:20 2013 +0400
@@ -42,12 +42,13 @@
                 next = first.next;
                 if (next == null) {
                     // this is the last element,
-                    // then try to update tail
+                    // then try to update the tail
                     if (first != Interlocked.CompareExchange(ref m_last, null, first)) {
-                        // this is inconsistent situation which means that the queue is empty
+                        // this is a ace condition
                         if (m_last == null)
+                            // the queue is empty
                             return false;
-                        // tail has been changed, that means that we need to restart
+                        // tail has been changed, than we need to restart
                         continue; 
                     }