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 <stddef.h> |
| 6 |
5 #include <algorithm> | 7 #include <algorithm> |
6 #include <vector> | 8 #include <vector> |
7 | 9 |
8 #include "base/logging.h" | 10 #include "base/logging.h" |
9 #include "base/synchronization/waitable_event.h" | |
10 #include "base/synchronization/condition_variable.h" | 11 #include "base/synchronization/condition_variable.h" |
11 #include "base/synchronization/lock.h" | 12 #include "base/synchronization/lock.h" |
| 13 #include "base/synchronization/waitable_event.h" |
12 #include "base/threading/thread_restrictions.h" | 14 #include "base/threading/thread_restrictions.h" |
13 | 15 |
14 // ----------------------------------------------------------------------------- | 16 // ----------------------------------------------------------------------------- |
15 // A WaitableEvent on POSIX is implemented as a wait-list. Currently we don't | 17 // A WaitableEvent on POSIX is implemented as a wait-list. Currently we don't |
16 // support cross-process events (where one process can signal an event which | 18 // support cross-process events (where one process can signal an event which |
17 // others are waiting on). Because of this, we can avoid having one thread per | 19 // others are waiting on). Because of this, we can avoid having one thread per |
18 // listener in several cases. | 20 // listener in several cases. |
19 // | 21 // |
20 // The WaitableEvent maintains a list of waiters, protected by a lock. Each | 22 // The WaitableEvent maintains a list of waiters, protected by a lock. Each |
21 // waiter is either an async wait, in which case we have a Task and the | 23 // waiter is either an async wait, in which case we have a Task and the |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 return true; | 408 return true; |
407 } | 409 } |
408 } | 410 } |
409 | 411 |
410 return false; | 412 return false; |
411 } | 413 } |
412 | 414 |
413 // ----------------------------------------------------------------------------- | 415 // ----------------------------------------------------------------------------- |
414 | 416 |
415 } // namespace base | 417 } // namespace base |
OLD | NEW |