OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/synchronization/waitable_event.h" | 5 #include "base/synchronization/waitable_event.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 #include <windows.h> | 8 #include <windows.h> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/threading/thread_restrictions.h" | 11 #include "base/threading/thread_restrictions.h" |
12 #include "base/time.h" | 12 #include "base/time/time.h" |
13 | 13 |
14 namespace base { | 14 namespace base { |
15 | 15 |
16 WaitableEvent::WaitableEvent(bool manual_reset, bool signaled) | 16 WaitableEvent::WaitableEvent(bool manual_reset, bool signaled) |
17 : handle_(CreateEvent(NULL, manual_reset, signaled, NULL)) { | 17 : handle_(CreateEvent(NULL, manual_reset, signaled, NULL)) { |
18 // We're probably going to crash anyways if this is ever NULL, so we might as | 18 // We're probably going to crash anyways if this is ever NULL, so we might as |
19 // well make our stack reports more informative by crashing here. | 19 // well make our stack reports more informative by crashing here. |
20 CHECK(handle_); | 20 CHECK(handle_); |
21 } | 21 } |
22 | 22 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 INFINITE); // no timeout | 93 INFINITE); // no timeout |
94 if (result >= WAIT_OBJECT_0 + count) { | 94 if (result >= WAIT_OBJECT_0 + count) { |
95 DLOG_GETLASTERROR(FATAL) << "WaitForMultipleObjects failed"; | 95 DLOG_GETLASTERROR(FATAL) << "WaitForMultipleObjects failed"; |
96 return 0; | 96 return 0; |
97 } | 97 } |
98 | 98 |
99 return result - WAIT_OBJECT_0; | 99 return result - WAIT_OBJECT_0; |
100 } | 100 } |
101 | 101 |
102 } // namespace base | 102 } // namespace base |
OLD | NEW |