| 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 #include "base/waitable_event.h" | 5 #include "base/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/time.h" | 11 #include "base/time.h" |
| 12 | 12 |
| 13 using base::TimeDelta; |
| 14 |
| 13 namespace base { | 15 namespace base { |
| 14 | 16 |
| 15 WaitableEvent::WaitableEvent(bool manual_reset, bool signaled) | 17 WaitableEvent::WaitableEvent(bool manual_reset, bool signaled) |
| 16 : event_(CreateEvent(NULL, manual_reset, signaled, NULL)) { | 18 : event_(CreateEvent(NULL, manual_reset, signaled, NULL)) { |
| 17 // We're probably going to crash anyways if this is ever NULL, so we might as | 19 // We're probably going to crash anyways if this is ever NULL, so we might as |
| 18 // well make our stack reports more informative by crashing here. | 20 // well make our stack reports more informative by crashing here. |
| 19 CHECK(event_); | 21 CHECK(event_); |
| 20 } | 22 } |
| 21 | 23 |
| 22 WaitableEvent::~WaitableEvent() { | 24 WaitableEvent::~WaitableEvent() { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 return false; | 59 return false; |
| 58 } | 60 } |
| 59 // It is most unexpected that this should ever fail. Help consumers learn | 61 // It is most unexpected that this should ever fail. Help consumers learn |
| 60 // about it if it should ever fail. | 62 // about it if it should ever fail. |
| 61 NOTREACHED() << "WaitForSingleObject failed"; | 63 NOTREACHED() << "WaitForSingleObject failed"; |
| 62 return false; | 64 return false; |
| 63 } | 65 } |
| 64 | 66 |
| 65 } // namespace base | 67 } // namespace base |
| 66 | 68 |
| OLD | NEW |