From f0d7195f5eae770fa1a1cf13d403a31c7d30b2a2 Mon Sep 17 00:00:00 2001 From: khizmax Date: Tue, 29 Nov 2016 23:40:15 +0300 Subject: [PATCH] [TSan] added annotation for suspicious (in terms of TSan) code --- src/hp_gc.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hp_gc.cpp b/src/hp_gc.cpp index 15c675ca..91bb6b54 100644 --- a/src/hp_gc.cpp +++ b/src/hp_gc.cpp @@ -150,8 +150,9 @@ namespace cds { namespace gc { hplist_node * pOldHead = m_pListHead.load( atomics::memory_order_acquire ); do { + // TSan: Next CAS release orders the memory + CDS_TSAN_ANNOTATE_HAPPENS_BEFORE(&hprec->m_pNextNode ); hprec->m_pNextNode = pOldHead; - CDS_TSAN_ANNOTATE_HAPPENS_BEFORE( &( hprec->m_pNextNode )); } while ( !m_pListHead.compare_exchange_weak( pOldHead, hprec, atomics::memory_order_release, atomics::memory_order_relaxed )); return hprec; -- 2.34.1