Reverted commit e32b8206c8fff235765277ee3f7c42517c4b52a5, use another way to fix...
authorkhizmax <libcds.dev@gmail.com>
Tue, 29 Nov 2016 19:36:29 +0000 (22:36 +0300)
committerkhizmax <libcds.dev@gmail.com>
Tue, 29 Nov 2016 19:36:29 +0000 (22:36 +0300)
cds/algo/flat_combining/defs.h
cds/algo/flat_combining/kernel.h

index 5b1d2ccdb52f83663018692111ef3ee5e5260758..a959e8ec6fda655e7134a53d410c7e0bb1ed4b88 100644 (file)
@@ -61,7 +61,6 @@ namespace cds { namespace algo { namespace flat_combining {
         atomics::atomic<unsigned int>           nState;     ///< Record state: inactive, active, removed
         atomics::atomic<unsigned int>           nAge;       ///< Age of the record
         atomics::atomic<publication_record *>   pNext;      ///< Next record in publication list
-        void *                                  pOwner;     ///< [internal data] Pointer to \ref kernel object that manages the publication list
 
         /// Initializes publication record
         publication_record()
@@ -69,7 +68,6 @@ namespace cds { namespace algo { namespace flat_combining {
             , nState( inactive )
             , nAge( 0 )
             , pNext( nullptr )
-            , pOwner( nullptr )
         {}
 
         /// Returns the value of \p nRequest field
index c0a3a7dcba7ed61630bd963d9b661923ad3b3ebf..cbc39b778b7bb1d9409c8cbef31507962a860e3e 100644 (file)
@@ -293,8 +293,6 @@ namespace cds { namespace algo {
             {
                 // mark all publication record as detached
                 for ( publication_record* p = m_pHead; p; ) {
-                    p->pOwner = nullptr;
-
                     publication_record * pRec = p;
                     p = p->pNext.load( memory_model::memory_order_relaxed );
                     free_publication_record( static_cast<publication_record_type *>( pRec ));
@@ -312,7 +310,6 @@ namespace cds { namespace algo {
                 if ( !pRec ) {
                     // Allocate new publication record
                     pRec = cxx11_allocator().New();
-                    pRec->pOwner = reinterpret_cast<void *>( this );
                     m_pThreadRec.reset( pRec );
                     m_Stat.onCreatePubRecord();
                 }
@@ -570,16 +567,7 @@ namespace cds { namespace algo {
             {
                 // Thread done
                 // pRec that is TLS data should be excluded from publication list
-                if ( pRec ) {
-                    if ( pRec->pOwner ) {
-                        // kernel is alive
-                        pRec->nState.store( removed, memory_model::memory_order_release );
-                    }
-                    else {
-                        // kernel already deleted
-                        free_publication_record( pRec );
-                    }
-                }
+                pRec->nState.store( removed, memory_model::memory_order_release );
             }
 
             static void free_publication_record( publication_record_type* pRec )
@@ -592,7 +580,6 @@ namespace cds { namespace algo {
                 assert( m_pThreadRec.get() == nullptr );
                 publication_record_type* pRec = cxx11_allocator().New();
                 m_pHead = pRec;
-                pRec->pOwner = this;
                 m_pThreadRec.reset( pRec );
                 m_Stat.onCreatePubRecord();
             }