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 // Multi-threaded tests of ConditionVariable class. | 5 // Multi-threaded tests of ConditionVariable class. |
6 | 6 |
7 #include <time.h> | 7 #include <time.h> |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/location.h" | 12 #include "base/location.h" |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/single_thread_task_runner.h" | 15 #include "base/single_thread_task_runner.h" |
16 #include "base/synchronization/condition_variable.h" | 16 #include "base/synchronization/condition_variable.h" |
17 #include "base/synchronization/lock.h" | 17 #include "base/synchronization/lock.h" |
18 #include "base/synchronization/spin_wait.h" | 18 #include "base/synchronization/spin_wait.h" |
19 #include "base/threading/platform_thread.h" | 19 #include "base/threading/platform_thread.h" |
20 #include "base/threading/thread.h" | 20 #include "base/threading/thread.h" |
21 #include "base/threading/thread_collision_warner.h" | 21 #include "base/threading/thread_collision_warner.h" |
22 #include "base/time/time.h" | 22 #include "base/time/time.h" |
23 #include "testing/gtest/include/gtest/gtest.h" | 23 #include "testing/gtest/googletest/include/gtest/gtest.h" |
24 #include "testing/platform_test.h" | 24 #include "testing/platform_test.h" |
25 | 25 |
26 namespace base { | 26 namespace base { |
27 | 27 |
28 namespace { | 28 namespace { |
29 //------------------------------------------------------------------------------ | 29 //------------------------------------------------------------------------------ |
30 // Define our test class, with several common variables. | 30 // Define our test class, with several common variables. |
31 //------------------------------------------------------------------------------ | 31 //------------------------------------------------------------------------------ |
32 | 32 |
33 class ConditionVariableTest : public PlatformTest { | 33 class ConditionVariableTest : public PlatformTest { |
(...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
756 base::AutoLock auto_lock(lock_); | 756 base::AutoLock auto_lock(lock_); |
757 // Send notification that we completed our "work." | 757 // Send notification that we completed our "work." |
758 WorkIsCompleted(thread_id); | 758 WorkIsCompleted(thread_id); |
759 } | 759 } |
760 } | 760 } |
761 } | 761 } |
762 | 762 |
763 } // namespace | 763 } // namespace |
764 | 764 |
765 } // namespace base | 765 } // namespace base |
OLD | NEW |