Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3001)

Unified Diff: base/tools_sanity_unittest.cc

Issue 13040003: Fix ToolsSanityTest.DataRace under TSan v1. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/tools_sanity_unittest.cc
===================================================================
--- base/tools_sanity_unittest.cc (revision 189999)
+++ base/tools_sanity_unittest.cc (working copy)
@@ -247,10 +247,11 @@
// A data race detector should report an error in this test.
TEST(ToolsSanityTest, DataRace) {
- bool shared = false;
- TOOLS_SANITY_TEST_CONCURRENT_THREAD thread1(&shared), thread2(&shared);
+ bool *shared = new bool(false);
Lei Zhang 2013/03/23 15:33:14 small nit: bool*
+ TOOLS_SANITY_TEST_CONCURRENT_THREAD thread1(shared), thread2(shared);
RunInParallel(&thread1, &thread2);
- EXPECT_TRUE(shared);
+ EXPECT_TRUE(*shared);
+ delete shared;
}
TEST(ToolsSanityTest, AnnotateBenignRace) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698