OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/dynamic_annotations.h" | |
6 #include "base/message_loop.h" | 5 #include "base/message_loop.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 { | 10 namespace { |
11 | 11 |
12 // We use caps here just to ensure that the method name doesn't interfere with | 12 // We use caps here just to ensure that the method name doesn't interfere with |
13 // the wildcarded suppressions. | 13 // the wildcarded suppressions. |
14 class TOOLS_SANITY_TEST_CONCURRENT_THREAD : public PlatformThread::Delegate { | 14 class TOOLS_SANITY_TEST_CONCURRENT_THREAD : public PlatformThread::Delegate { |
15 public: | 15 public: |
16 explicit TOOLS_SANITY_TEST_CONCURRENT_THREAD(bool *value) : value_(value) {} | 16 explicit TOOLS_SANITY_TEST_CONCURRENT_THREAD(bool *value) : value_(value) {} |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 new TOOLS_SANITY_TEST_CONCURRENT_THREAD(&shared); | 111 new TOOLS_SANITY_TEST_CONCURRENT_THREAD(&shared); |
112 | 112 |
113 PlatformThread::Create(0, thread1, &a); | 113 PlatformThread::Create(0, thread1, &a); |
114 PlatformThread::Create(0, thread2, &b); | 114 PlatformThread::Create(0, thread2, &b); |
115 PlatformThread::Join(a); | 115 PlatformThread::Join(a); |
116 PlatformThread::Join(b); | 116 PlatformThread::Join(b); |
117 EXPECT_TRUE(shared); | 117 EXPECT_TRUE(shared); |
118 delete thread1; | 118 delete thread1; |
119 delete thread2; | 119 delete thread2; |
120 } | 120 } |
OLD | NEW |