[TSan] Added annotation for std::shared_ptr::~shared_ptr to hide false positive report
authorkhizmax <libcds.dev@gmail.com>
Sat, 8 Jul 2017 08:51:57 +0000 (11:51 +0300)
committerkhizmax <libcds.dev@gmail.com>
Sat, 8 Jul 2017 08:51:57 +0000 (11:51 +0300)
cds/intrusive/cuckoo_set.h

index 88bd7187bea1cd4d671afcdc89800334966e541e..10a77026d1afa6b876a8d8362782c8cc1ed81b9c 100644 (file)
@@ -697,7 +697,12 @@ namespace cds { namespace intrusive {
             struct lock_array_disposer {
                 void operator()( lock_array_type * pArr )
                 {
+                    // Seems, there is a false positive in std::shared_ptr deallocation in uninstrumented libc++
+                    // see, for example, https://groups.google.com/forum/#!topic/thread-sanitizer/eHu4dE_z7Cc
+                    // https://reviews.llvm.org/D21609
+                    CDS_TSAN_ANNOTATE_IGNORE_WRITES_BEGIN;
                     lock_array_allocator().Delete( pArr );
+                    CDS_TSAN_ANNOTATE_IGNORE_WRITES_END;
                 }
             };