| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 MOJO_SYSTEM_WAITER_LIST_H_ | 5 #ifndef MOJO_SYSTEM_WAITER_LIST_H_ |
| 6 #define MOJO_SYSTEM_WAITER_LIST_H_ | 6 #define MOJO_SYSTEM_WAITER_LIST_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <list> | 10 #include <list> |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 // object (see simple_dispatcher.* and the explanatory comment in core.cc). This | 26 // object (see simple_dispatcher.* and the explanatory comment in core.cc). This |
| 27 // class is thread-unsafe (all concurrent access must be protected by some | 27 // class is thread-unsafe (all concurrent access must be protected by some |
| 28 // lock). | 28 // lock). |
| 29 class MOJO_SYSTEM_IMPL_EXPORT WaiterList { | 29 class MOJO_SYSTEM_IMPL_EXPORT WaiterList { |
| 30 public: | 30 public: |
| 31 WaiterList(); | 31 WaiterList(); |
| 32 ~WaiterList(); | 32 ~WaiterList(); |
| 33 | 33 |
| 34 void AwakeWaitersForStateChange(const WaitFlagsState& state); | 34 void AwakeWaitersForStateChange(const WaitFlagsState& state); |
| 35 void CancelAllWaiters(); | 35 void CancelAllWaiters(); |
| 36 void AddWaiter(Waiter* waiter, MojoWaitFlags flags, uint32_t context); | 36 void AddWaiter(Waiter* waiter, MojoHandleSignals signals, uint32_t context); |
| 37 void RemoveWaiter(Waiter* waiter); | 37 void RemoveWaiter(Waiter* waiter); |
| 38 | 38 |
| 39 private: | 39 private: |
| 40 struct WaiterInfo { | 40 struct WaiterInfo { |
| 41 WaiterInfo(Waiter* waiter, MojoWaitFlags flags, uint32_t context) | 41 WaiterInfo(Waiter* waiter, MojoHandleSignals signals, uint32_t context) |
| 42 : waiter(waiter), flags(flags), context(context) {} | 42 : waiter(waiter), signals(signals), context(context) {} |
| 43 | 43 |
| 44 Waiter* waiter; | 44 Waiter* waiter; |
| 45 MojoWaitFlags flags; | 45 MojoHandleSignals signals; |
| 46 uint32_t context; | 46 uint32_t context; |
| 47 }; | 47 }; |
| 48 typedef std::list<WaiterInfo> WaiterInfoList; | 48 typedef std::list<WaiterInfo> WaiterInfoList; |
| 49 | 49 |
| 50 WaiterInfoList waiters_; | 50 WaiterInfoList waiters_; |
| 51 | 51 |
| 52 DISALLOW_COPY_AND_ASSIGN(WaiterList); | 52 DISALLOW_COPY_AND_ASSIGN(WaiterList); |
| 53 }; | 53 }; |
| 54 | 54 |
| 55 } // namespace system | 55 } // namespace system |
| 56 } // namespace mojo | 56 } // namespace mojo |
| 57 | 57 |
| 58 #endif // MOJO_SYSTEM_WAITER_LIST_H_ | 58 #endif // MOJO_SYSTEM_WAITER_LIST_H_ |
| OLD | NEW |