Chromium Code Reviews| Index: mojo/edk/system/watcher_dispatcher.h |
| diff --git a/mojo/edk/system/watcher_dispatcher.h b/mojo/edk/system/watcher_dispatcher.h |
| index 9698818272ea68ca319dd912e55acf4573eac991..3529e7fe1d171101941acb90ebedce773c2cfe7b 100644 |
| --- a/mojo/edk/system/watcher_dispatcher.h |
| +++ b/mojo/edk/system/watcher_dispatcher.h |
| @@ -55,6 +55,8 @@ class WatcherDispatcher : public Dispatcher { |
| private: |
| friend class Watch; |
| + using WatchSet = std::set<Watch*>; |
| + |
| ~WatcherDispatcher() override; |
| const MojoWatcherCallback callback_; |
| @@ -80,7 +82,12 @@ class WatcherDispatcher : public Dispatcher { |
| // used for efficient arming behavior, as it allows for O(1) discovery of |
| // whether or not arming can succeed and quick determination of who's |
| // responsible if it can't. |
| - std::set<Watch*> ready_watches_; |
| + WatchSet ready_watches_; |
| + |
| + // Tracks the last Watch whose state was returned by Arm(). This is used to |
| + // ensure consistent round-robin behavior in the event that multiple Watches |
| + // remain ready over the span of several Arm() attempts. |
| + Watch* last_watch_to_block_arming_ = nullptr; |
|
yzshen1
2017/03/16 18:59:01
Please comment that this pointer may not refer to
Ken Rockot(use gerrit already)
2017/03/16 19:21:11
Done
|
| DISALLOW_COPY_AND_ASSIGN(WatcherDispatcher); |
| }; |