OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 COMPONENTS_SYNC_BASE_SCOPED_EVENT_SIGNAL_H_ | 5 #ifndef COMPONENTS_SYNC_BASE_SCOPED_EVENT_SIGNAL_H_ |
6 #define COMPONENTS_SYNC_BASE_SCOPED_EVENT_SIGNAL_H_ | 6 #define COMPONENTS_SYNC_BASE_SCOPED_EVENT_SIGNAL_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 | 9 |
10 namespace base { | 10 namespace base { |
(...skipping 11 matching lines...) Expand all Loading... |
22 | 22 |
23 // This ScopedEventSignal will signal |other|'s WaitableEvent in its | 23 // This ScopedEventSignal will signal |other|'s WaitableEvent in its |
24 // destructor. |other| will not signal anything in its destructor. The | 24 // destructor. |other| will not signal anything in its destructor. The |
25 // assignment operator cannot be used if this ScopedEventSignal's | 25 // assignment operator cannot be used if this ScopedEventSignal's |
26 // WaitableEvent hasn't been moved to another ScopedEventSignal. | 26 // WaitableEvent hasn't been moved to another ScopedEventSignal. |
27 ScopedEventSignal(ScopedEventSignal&& other); | 27 ScopedEventSignal(ScopedEventSignal&& other); |
28 ScopedEventSignal& operator=(ScopedEventSignal&& other); | 28 ScopedEventSignal& operator=(ScopedEventSignal&& other); |
29 | 29 |
30 ~ScopedEventSignal(); | 30 ~ScopedEventSignal(); |
31 | 31 |
| 32 // Whether the wrapped event has been signaled already. |
| 33 bool IsSignaled() const; |
| 34 |
32 private: | 35 private: |
33 base::WaitableEvent* event_; | 36 base::WaitableEvent* event_; |
34 | 37 |
35 DISALLOW_COPY_AND_ASSIGN(ScopedEventSignal); | 38 DISALLOW_COPY_AND_ASSIGN(ScopedEventSignal); |
36 }; | 39 }; |
37 | 40 |
38 } // namespace syncer | 41 } // namespace syncer |
39 | 42 |
40 #endif // COMPONENTS_SYNC_BASE_SCOPED_EVENT_SIGNAL_H_ | 43 #endif // COMPONENTS_SYNC_BASE_SCOPED_EVENT_SIGNAL_H_ |
OLD | NEW |