| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #ifndef BASE_WAITABLE_EVENT_H_ | 5 #ifndef BASE_WAITABLE_EVENT_H_ |
| 6 #define BASE_WAITABLE_EVENT_H_ | 6 #define BASE_WAITABLE_EVENT_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 | 9 |
| 10 #if defined(OS_WIN) | 10 #if defined(OS_WIN) |
| 11 #include <windows.h> | 11 #include <windows.h> |
| 12 #endif | 12 #endif |
| 13 | 13 |
| 14 #if defined(OS_POSIX) | 14 #if defined(OS_POSIX) |
| 15 #include <list> | 15 #include <list> |
| 16 #include <utility> | 16 #include <utility> |
| 17 #include "base/condition_variable.h" | |
| 18 #include "base/lock.h" | 17 #include "base/lock.h" |
| 19 #include "base/ref_counted.h" | 18 #include "base/ref_counted.h" |
| 20 #endif | 19 #endif |
| 21 | 20 |
| 22 #include "base/message_loop.h" | |
| 23 | |
| 24 namespace base { | 21 namespace base { |
| 25 | 22 |
| 26 // This replaces INFINITE from Win32 | 23 // This replaces INFINITE from Win32 |
| 27 static const int kNoTimeout = -1; | 24 static const int kNoTimeout = -1; |
| 28 | 25 |
| 29 class TimeDelta; | 26 class TimeDelta; |
| 30 | 27 |
| 31 // A WaitableEvent can be a useful thread synchronization tool when you want to | 28 // A WaitableEvent can be a useful thread synchronization tool when you want to |
| 32 // allow one thread to wait for another thread to finish some work. For | 29 // allow one thread to wait for another thread to finish some work. For |
| 33 // non-Windows systems, this can only be used from within a single address | 30 // non-Windows systems, this can only be used from within a single address |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 static size_t EnqueueMany(WaiterAndIndex* waitables, | 168 static size_t EnqueueMany(WaiterAndIndex* waitables, |
| 172 size_t count, Waiter* waiter); | 169 size_t count, Waiter* waiter); |
| 173 #endif | 170 #endif |
| 174 | 171 |
| 175 DISALLOW_COPY_AND_ASSIGN(WaitableEvent); | 172 DISALLOW_COPY_AND_ASSIGN(WaitableEvent); |
| 176 }; | 173 }; |
| 177 | 174 |
| 178 } // namespace base | 175 } // namespace base |
| 179 | 176 |
| 180 #endif // BASE_WAITABLE_EVENT_H_ | 177 #endif // BASE_WAITABLE_EVENT_H_ |
| OLD | NEW |