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 #ifndef BASE_SYNCHRONIZATION_WAITABLE_EVENT_H_ | 5 #ifndef BASE_SYNCHRONIZATION_WAITABLE_EVENT_H_ |
6 #define BASE_SYNCHRONIZATION_WAITABLE_EVENT_H_ | 6 #define BASE_SYNCHRONIZATION_WAITABLE_EVENT_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/base_export.h" | 9 #include "base/base_export.h" |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 void Reset(); | 66 void Reset(); |
67 | 67 |
68 // Put the event in the signaled state. Causing any thread blocked on Wait | 68 // Put the event in the signaled state. Causing any thread blocked on Wait |
69 // to be woken up. | 69 // to be woken up. |
70 void Signal(); | 70 void Signal(); |
71 | 71 |
72 // Returns true if the event is in the signaled state, else false. If this | 72 // Returns true if the event is in the signaled state, else false. If this |
73 // is not a manual reset event, then this test will cause a reset. | 73 // is not a manual reset event, then this test will cause a reset. |
74 bool IsSignaled(); | 74 bool IsSignaled(); |
75 | 75 |
76 // Wait indefinitely for the event to be signaled. Returns true if the event | 76 // Wait indefinitely for the event to be signaled. |
77 // was signaled, else false is returned to indicate that waiting failed. | 77 void Wait(); |
78 bool Wait(); | |
79 | 78 |
80 // Wait up until max_time has passed for the event to be signaled. Returns | 79 // Wait up until max_time has passed for the event to be signaled. Returns |
81 // true if the event was signaled. If this method returns false, then it | 80 // true if the event was signaled. If this method returns false, then it |
82 // does not necessarily mean that max_time was exceeded. | 81 // does not necessarily mean that max_time was exceeded. |
83 bool TimedWait(const TimeDelta& max_time); | 82 bool TimedWait(const TimeDelta& max_time); |
84 | 83 |
85 #if defined(OS_WIN) | 84 #if defined(OS_WIN) |
86 HANDLE handle() const { return handle_; } | 85 HANDLE handle() const { return handle_; } |
87 #endif | 86 #endif |
88 | 87 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 | 171 |
173 scoped_refptr<WaitableEventKernel> kernel_; | 172 scoped_refptr<WaitableEventKernel> kernel_; |
174 #endif | 173 #endif |
175 | 174 |
176 DISALLOW_COPY_AND_ASSIGN(WaitableEvent); | 175 DISALLOW_COPY_AND_ASSIGN(WaitableEvent); |
177 }; | 176 }; |
178 | 177 |
179 } // namespace base | 178 } // namespace base |
180 | 179 |
181 #endif // BASE_SYNCHRONIZATION_WAITABLE_EVENT_H_ | 180 #endif // BASE_SYNCHRONIZATION_WAITABLE_EVENT_H_ |
OLD | NEW |