| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/atomic_sequence_num.h" | 5 #include "base/atomic_sequence_num.h" |
| 6 #include "base/strings/string_number_conversions.h" | 6 #include "base/strings/string_number_conversions.h" |
| 7 #include "base/synchronization/waitable_event.h" | 7 #include "base/synchronization/waitable_event.h" |
| 8 #include "base/threading/simple_thread.h" | 8 #include "base/threading/simple_thread.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/googletest/include/gtest/gtest.h" |
| 10 | 10 |
| 11 namespace base { | 11 namespace base { |
| 12 | 12 |
| 13 namespace { | 13 namespace { |
| 14 | 14 |
| 15 class SetIntRunner : public DelegateSimpleThread::Delegate { | 15 class SetIntRunner : public DelegateSimpleThread::Delegate { |
| 16 public: | 16 public: |
| 17 SetIntRunner(int* ptr, int val) : ptr_(ptr), val_(val) { } | 17 SetIntRunner(int* ptr, int val) : ptr_(ptr), val_(val) { } |
| 18 ~SetIntRunner() override {} | 18 ~SetIntRunner() override {} |
| 19 | 19 |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 VerifyPoolRunner verifier(&seq2, 9, &event); | 157 VerifyPoolRunner verifier(&seq2, 9, &event); |
| 158 pool.Start(); | 158 pool.Start(); |
| 159 | 159 |
| 160 pool.AddWork(&verifier, 10); | 160 pool.AddWork(&verifier, 10); |
| 161 | 161 |
| 162 pool.JoinAll(); | 162 pool.JoinAll(); |
| 163 EXPECT_EQ(seq2.GetNext(), 10); | 163 EXPECT_EQ(seq2.GetNext(), 10); |
| 164 } | 164 } |
| 165 | 165 |
| 166 } // namespace base | 166 } // namespace base |
| OLD | NEW |