From: khizmax Date: Sun, 28 Jun 2015 16:34:08 +0000 (+0300) Subject: Suppressed TSan false positive warnings X-Git-Tag: v2.1.0~196 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=5a1468926ea9208e77106c4faa4809f03167ef94;p=libcds.git Suppressed TSan false positive warnings --- diff --git a/cds/intrusive/fcqueue.h b/cds/intrusive/fcqueue.h index 630b2ae3..bde69083 100644 --- a/cds/intrusive/fcqueue.h +++ b/cds/intrusive/fcqueue.h @@ -261,6 +261,7 @@ namespace cds { namespace intrusive { assert( pRec ); // this function is called under FC mutex, so switch TSan off + // All TSan warnings are false positive CDS_TSAN_ANNOTATE_IGNORE_RW_BEGIN; switch ( pRec->op() ) { @@ -292,6 +293,7 @@ namespace cds { namespace intrusive { void fc_process( typename fc_kernel::iterator itBegin, typename fc_kernel::iterator itEnd ) { // this function is called under FC mutex, so switch TSan off + // All TSan warnings are false positive CDS_TSAN_ANNOTATE_IGNORE_RW_BEGIN; typedef typename fc_kernel::iterator fc_iterator; diff --git a/cds/intrusive/optimistic_queue.h b/cds/intrusive/optimistic_queue.h index aba66db3..5277c4c0 100644 --- a/cds/intrusive/optimistic_queue.h +++ b/cds/intrusive/optimistic_queue.h @@ -32,11 +32,10 @@ namespace cds { namespace intrusive { atomic_node_ptr m_pNext ; ///< Pointer to next node atomic_node_ptr m_pPrev ; ///< Pointer to previous node - node() CDS_NOEXCEPT - { - m_pNext.store( nullptr, atomics::memory_order_release ); - m_pPrev.store( nullptr, atomics::memory_order_release ); - } + CDS_CONSTEXPR node() CDS_NOEXCEPT + : m_pNext( nullptr ) + , m_pPrev( nullptr ) + {} }; //@cond diff --git a/tests/unit/queue/intrusive_queue_reader_writer.cpp b/tests/unit/queue/intrusive_queue_reader_writer.cpp index b5ad38c4..f927113f 100644 --- a/tests/unit/queue/intrusive_queue_reader_writer.cpp +++ b/tests/unit/queue/intrusive_queue_reader_writer.cpp @@ -85,6 +85,7 @@ namespace queue { for ( typename Queue::value_type * p = m_pStart; p < m_pEnd; ) { p->nNo = i; p->nWriterNo = m_nThreadNo; + CDS_TSAN_ANNOTATE_HAPPENS_BEFORE( &p->nWriterNo ); if ( m_Queue.push( *p )) { ++p; ++i; @@ -170,6 +171,7 @@ namespace queue { if ( p ) { p->nConsumer = m_nThreadNo; ++m_nPopped; + CDS_TSAN_ANNOTATE_HAPPENS_AFTER( &p->nWriterNo ); if ( p->nWriterNo < nTotalWriters ) m_WriterData[ p->nWriterNo ].push_back( p->nNo ); else diff --git a/tools/tsan-suppression b/tools/tsan-suppression index 9f5e1565..f46e16d8 100644 --- a/tools/tsan-suppression +++ b/tools/tsan-suppression @@ -6,3 +6,5 @@ race:cds::gc::details::retired_ptr::free # uRCU false positive race:cds::urcu::gc*::batch_retire* + +race:cds::container::OptimisticQueue*::alloc_node