use atomic for global test counters
TSAN is failing because
multiple threads are incrementing the
same global
TBR=mtklein@google.com
Bug: skia:
Change-Id: I9c3bc6bb4aa7cbe7ced5b3080790d3c4ad1ff798
Reviewed-on: https://skia-review.googlesource.com/146446
Commit-Queue: Cary Clark <caryclark@skia.org>
Reviewed-by: Cary Clark <caryclark@skia.org>
Auto-Submit: Cary Clark <caryclark@skia.org>
diff --git a/tests/PathOpsTigerTest.cpp b/tests/PathOpsTigerTest.cpp
index bf9ebd6..9068b03 100644
--- a/tests/PathOpsTigerTest.cpp
+++ b/tests/PathOpsTigerTest.cpp
@@ -7,6 +7,7 @@
#include "PathOpsDebug.h"
#include "PathOpsExtendedTest.h"
#include "PathOpsThreadedCommon.h"
+#include <atomic>
#define TEST(name) { name, #name }
@@ -133,7 +134,7 @@
testSimplify(reporter, path, filename);
}
-int gTigerTests = 0;
+static std::atomic<int> gTigerTests{0};
static void tiger8a_x(skiatest::Reporter* reporter, uint64_t testlines) {
SkPath path;