Revert prev change
authorkhizmax <khizmax@gmail.com>
Fri, 29 Jul 2016 09:20:13 +0000 (12:20 +0300)
committerkhizmax <khizmax@gmail.com>
Fri, 29 Jul 2016 09:20:13 +0000 (12:20 +0300)
cds/intrusive/mspriority_queue.h
test/stress/pqueue/pop.cpp

index 6c78272..41fd568 100644 (file)
@@ -323,7 +323,8 @@ namespace cds { namespace intrusive {
                 m_Stat.onPopFailed();
                 return nullptr;
             }
-            counter_type nBottom = m_ItemCounter.dec();
+            counter_type nBottom = m_ItemCounter.reversed_value();
+            m_ItemCounter.dec();
             assert( nBottom < m_Heap.capacity() );
             assert( nBottom > 0 );
 
index 75704ed..a525319 100644 (file)
@@ -70,25 +70,6 @@ namespace {
                     ++m_nPopSuccess;
                     nPrevKey = val.key;
 
-                    /*
-                    while ( !m_Queue.empty() ) {
-                        if ( m_Queue.pop( val )) {
-                            ++m_nPopSuccess;
-                            if ( val.key > nPrevKey ) {
-                                ++m_nPopError;
-                                m_arrFailedPops.emplace_back( failed_pops{ nPrevKey, val.key } );
-                            }
-                            else if ( val.key == nPrevKey ) {
-                                ++m_nPopErrorEq;
-                                m_arrFailedPops.emplace_back( failed_pops{ nPrevKey, val.key } );
-                            }
-                            nPrevKey = val.key;
-                        }
-                        else
-                            ++m_nPopFailed;
-                    }
-                    */
-
                     while ( m_Queue.pop( val )) {
                         ++m_nPopSuccess;
                         if ( val.key > nPrevKey ) {