mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-11 04:26:38 +00:00
sys_util: poll: add iter_writable to set of methods for PollEvents
There were already methods for the readable and hungup events, so this completes the set. TEST=None BUG=chromium:1023975 Change-Id: Ie9cd1459893cc8b6ba7a52e638e164095ddbcba5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1930404 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Stephen Barber <smbarber@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
This commit is contained in:
parent
1a2683b90d
commit
e3f1271842
1 changed files with 9 additions and 0 deletions
|
@ -201,6 +201,15 @@ impl<'a, T: PollToken> PollEvents<'a, T> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Iterates over each writable event.
|
||||||
|
pub fn iter_writable(&self) -> PollEventIter<slice::Iter<epoll_event>, T> {
|
||||||
|
PollEventIter {
|
||||||
|
mask: EPOLLOUT as u32,
|
||||||
|
iter: self.events[..self.count].iter(),
|
||||||
|
tokens: PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Iterates over each hungup event.
|
/// Iterates over each hungup event.
|
||||||
pub fn iter_hungup(&self) -> PollEventIter<slice::Iter<epoll_event>, T> {
|
pub fn iter_hungup(&self) -> PollEventIter<slice::Iter<epoll_event>, T> {
|
||||||
PollEventIter {
|
PollEventIter {
|
||||||
|
|
Loading…
Reference in a new issue