From 0776a0b8770d302df472b5cbdfe4132867c3e186 Mon Sep 17 00:00:00 2001 From: khizmax Date: Tue, 21 Oct 2014 23:55:58 +0400 Subject: [PATCH] remove base class and gc::HRC specialization for intrusive::single_link::node remove MSVC warning C4522 for details::marked_ptr --- cds/details/marked_ptr.h | 5 +- cds/intrusive/details/single_link_struct.h | 63 +--------------------- 2 files changed, 5 insertions(+), 63 deletions(-) diff --git a/cds/details/marked_ptr.h b/cds/details/marked_ptr.h index ade4d3f8..39a84e90 100644 --- a/cds/details/marked_ptr.h +++ b/cds/details/marked_ptr.h @@ -338,13 +338,16 @@ CDS_CXX11_ATOMIC_BEGIN_NAMESPACE atomic(const atomic&) = delete; atomic& operator=(const atomic&) = delete; - atomic& operator=(const atomic&) volatile = delete; +#if !(CDS_COMPILER == CDS_COMPILER_MSVC && CDS_COMPILER_VERSION <= CDS_COMPILER_MSVC12) + // MSVC12: warning C4522: multiple assignment operators specified + atomic& operator=(const atomic&) volatile = delete; marked_ptr operator=(marked_ptr val) volatile CDS_NOEXCEPT { store( val ); return val; } +#endif marked_ptr operator=(marked_ptr val) CDS_NOEXCEPT { store( val ); diff --git a/cds/intrusive/details/single_link_struct.h b/cds/intrusive/details/single_link_struct.h index 8796e35c..2b02e797 100644 --- a/cds/intrusive/details/single_link_struct.h +++ b/cds/intrusive/details/single_link_struct.h @@ -6,7 +6,6 @@ #include #include #include -#include namespace cds { namespace intrusive { @@ -22,7 +21,7 @@ namespace cds { namespace intrusive { - Tag - a tag used to distinguish between different implementation */ template - struct node: public GC::container_node + struct node { typedef GC gc ; ///< Garbage collector typedef Tag tag ; ///< tag @@ -42,53 +41,6 @@ namespace cds { namespace intrusive { {} }; - //@cond - // Specialization for HRC GC - template - struct node< gc::HRC, Tag>: public gc::HRC::container_node - { - typedef gc::HRC gc ; ///< Garbage collector - typedef Tag tag ; ///< tag - - typedef gc::atomic_ref atomic_node_ptr ; ///< atomic pointer - atomic_node_ptr m_pNext ; ///< pointer to the next node in the container - - node() - : m_pNext( nullptr ) - {} - - protected: - virtual void cleanUp( cds::gc::hrc::ThreadGC * pGC ) - { - assert( pGC != nullptr ); - typename gc::GuardArray<2> aGuards( *pGC ); - - while ( true ) { - node * pNext = aGuards.protect( 0, m_pNext ); - if ( pNext && pNext->m_bDeleted.load(atomics::memory_order_acquire) ) { - node * p = aGuards.protect( 1, pNext->m_pNext ); - m_pNext.compare_exchange_strong( pNext, p, atomics::memory_order_acquire, atomics::memory_order_relaxed ); - continue; - } - else { - break; - } - } - } - - virtual void terminate( cds::gc::hrc::ThreadGC * pGC, bool bConcurrent ) - { - if ( bConcurrent ) { - node * pNext = m_pNext.load(atomics::memory_order_relaxed); - do {} while ( !m_pNext.compare_exchange_weak( pNext, nullptr, atomics::memory_order_release, atomics::memory_order_relaxed ) ); - } - else { - m_pNext.store( nullptr, atomics::memory_order_relaxed ); - } - } - }; - //@endcond - //@cond struct default_hook { typedef cds::gc::default_gc gc; @@ -108,7 +60,6 @@ namespace cds { namespace intrusive { }; //@endcond - /// Base hook /** \p Options are: @@ -174,18 +125,6 @@ namespace cds { namespace intrusive { template struct link_checker_selector; - template - struct link_checker_selector< gc::HRC, Node, opt::never_check_link > - { - typedef link_checker type; - }; - - template - struct link_checker_selector< gc::HRC, Node, opt::debug_check_link > - { - typedef link_checker type; - }; - template struct link_checker_selector< GC, Node, opt::never_check_link > { -- 2.34.1