Writing to testName and reading its size isn't thread safe, TSAN reminds us.
authorcommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Tue, 1 Oct 2013 18:44:04 +0000 (18:44 +0000)
committercommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Tue, 1 Oct 2013 18:44:04 +0000 (18:44 +0000)
Guarding it into a no-op makes it safe.  Looks like this is only used for debugging, presumably singlethreaded?

BUG=
R=caryclark@google.com

Author: mtklein@google.com

Review URL: https://codereview.chromium.org/25366002

git-svn-id: http://skia.googlecode.com/svn/trunk@11562 2bbb7eff-a529-9590-31e7-b0007b416f81

tests/PathOpsExtendedTest.cpp

index efee0fc..c32bfa1 100644 (file)
@@ -632,6 +632,7 @@ int initializeTests(skiatest::Reporter* reporter, const char* test) {
     SkPathOpsDebug::gMaxWindSum = 4;
     SkPathOpsDebug::gMaxWindValue = 4;
 #endif
+#if DEBUG_SHOW_TEST_NAME
     testName = test;
     size_t testNameSize = strlen(test);
     SkFILEStream inFile("../../experimental/Intersection/op.htm");
@@ -648,6 +649,7 @@ int initializeTests(skiatest::Reporter* reporter, const char* test) {
             testNumber = atoi(numLoc) + 1;
         }
     }
+#endif
     return reporter->allowThreaded() ? SkThreadPool::kThreadPerCore : 1;
 }