Silence tsan false-positives (tsan can't track things which are only safe due to
[oota-llvm.git] / lib / Support / Statistic.cpp
index 04a44a0f7113429d8d36f51b8a3304897e07115f..d8a6ad35ba9cae8805ab9c9f3c1cef2ace2d1ba6 100644 (file)
@@ -73,9 +73,12 @@ void Statistic::RegisterStatistic() {
     if (Enabled)
       StatInfo->addStatistic(this);
 
+    TsanHappensBefore(this);
     sys::MemoryFence();
     // Remember we have been registered.
+    TsanIgnoreWritesBegin();
     Initialized = true;
+    TsanIgnoreWritesEnd();
   }
 }