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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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. Returns true if the event |
77 // was signaled, else false is returned to indicate that waiting failed. | 77 // was signaled, else false is returned to indicate that waiting failed. |
willchan no longer on Chromium
2011/10/11 15:04:55
Please update the comments.
| |
78 bool Wait(); | 78 void Wait(); |
79 | 79 |
80 // Wait up until max_time has passed for the event to be signaled. Returns | 80 // 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 | 81 // true if the event was signaled. If this method returns false, then it |
82 // does not necessarily mean that max_time was exceeded. | 82 // does not necessarily mean that max_time was exceeded. |
83 bool TimedWait(const TimeDelta& max_time); | 83 bool TimedWait(const TimeDelta& max_time); |
84 | 84 |
85 #if defined(OS_WIN) | 85 #if defined(OS_WIN) |
86 HANDLE handle() const { return handle_; } | 86 HANDLE handle() const { return handle_; } |
87 #endif | 87 #endif |
88 | 88 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
172 | 172 |
173 scoped_refptr<WaitableEventKernel> kernel_; | 173 scoped_refptr<WaitableEventKernel> kernel_; |
174 #endif | 174 #endif |
175 | 175 |
176 DISALLOW_COPY_AND_ASSIGN(WaitableEvent); | 176 DISALLOW_COPY_AND_ASSIGN(WaitableEvent); |
177 }; | 177 }; |
178 | 178 |
179 } // namespace base | 179 } // namespace base |
180 | 180 |
181 #endif // BASE_SYNCHRONIZATION_WAITABLE_EVENT_H_ | 181 #endif // BASE_SYNCHRONIZATION_WAITABLE_EVENT_H_ |
OLD | NEW |