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

Side by Side Diff: base/tools_sanity_unittest.cc

Issue 6001010: Move platform_thread to base/threading and put in the base namespace. I left ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/timer_unittest.cc ('k') | base/waitable_event_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/message_loop.h" 5 #include "base/message_loop.h"
6 #include "base/third_party/dynamic_annotations/dynamic_annotations.h" 6 #include "base/third_party/dynamic_annotations/dynamic_annotations.h"
7 #include "base/thread.h" 7 #include "base/thread.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 namespace base {
11
10 namespace { 12 namespace {
11 13
12 // We use caps here just to ensure that the method name doesn't interfere with 14 // We use caps here just to ensure that the method name doesn't interfere with
13 // the wildcarded suppressions. 15 // the wildcarded suppressions.
14 class TOOLS_SANITY_TEST_CONCURRENT_THREAD : public PlatformThread::Delegate { 16 class TOOLS_SANITY_TEST_CONCURRENT_THREAD : public PlatformThread::Delegate {
15 public: 17 public:
16 explicit TOOLS_SANITY_TEST_CONCURRENT_THREAD(bool *value) : value_(value) {} 18 explicit TOOLS_SANITY_TEST_CONCURRENT_THREAD(bool *value) : value_(value) {}
17 ~TOOLS_SANITY_TEST_CONCURRENT_THREAD() {} 19 ~TOOLS_SANITY_TEST_CONCURRENT_THREAD() {}
18 void ThreadMain() { 20 void ThreadMain() {
19 *value_ = true; 21 *value_ = true;
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 new TOOLS_SANITY_TEST_CONCURRENT_THREAD(&shared); 131 new TOOLS_SANITY_TEST_CONCURRENT_THREAD(&shared);
130 132
131 PlatformThread::Create(0, thread1, &a); 133 PlatformThread::Create(0, thread1, &a);
132 PlatformThread::Create(0, thread2, &b); 134 PlatformThread::Create(0, thread2, &b);
133 PlatformThread::Join(a); 135 PlatformThread::Join(a);
134 PlatformThread::Join(b); 136 PlatformThread::Join(b);
135 EXPECT_TRUE(shared); 137 EXPECT_TRUE(shared);
136 delete thread1; 138 delete thread1;
137 delete thread2; 139 delete thread2;
138 } 140 }
141
142 } // namespace base
OLDNEW
« no previous file with comments | « base/timer_unittest.cc ('k') | base/waitable_event_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698