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 "build/build_config.h" |
23 #include "testing/gtest/include/gtest/gtest.h" | 24 #include "testing/gtest/include/gtest/gtest.h" |
24 #include "testing/platform_test.h" | 25 #include "testing/platform_test.h" |
25 | 26 |
26 namespace base { | 27 namespace base { |
27 | 28 |
28 namespace { | 29 namespace { |
29 //------------------------------------------------------------------------------ | 30 //------------------------------------------------------------------------------ |
30 // Define our test class, with several common variables. | 31 // Define our test class, with several common variables. |
31 //------------------------------------------------------------------------------ | 32 //------------------------------------------------------------------------------ |
32 | 33 |
(...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
756 base::AutoLock auto_lock(lock_); | 757 base::AutoLock auto_lock(lock_); |
757 // Send notification that we completed our "work." | 758 // Send notification that we completed our "work." |
758 WorkIsCompleted(thread_id); | 759 WorkIsCompleted(thread_id); |
759 } | 760 } |
760 } | 761 } |
761 } | 762 } |
762 | 763 |
763 } // namespace | 764 } // namespace |
764 | 765 |
765 } // namespace base | 766 } // namespace base |
OLD | NEW |