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/PathOpsChalkboardTest.cpp b/tests/PathOpsChalkboardTest.cpp
index 2c77da2..cdf1fc6 100644
--- a/tests/PathOpsChalkboardTest.cpp
+++ b/tests/PathOpsChalkboardTest.cpp
@@ -7,10 +7,11 @@
#include "PathOpsExtendedTest.h"
#include "PathOpsThreadedCommon.h"
#include "SkRandom.h"
+#include <atomic>
#define TEST(name) { name, #name }
-static int gTestNo = 0;
+static std::atomic<int> gTestNo{0};
static void chalkboard(skiatest::Reporter* reporter, uint64_t testlines) {
SkPath path;