mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-24 01:43:22 +00:00
Avoid duplicate wait_events
methods
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
6e8896165d
commit
ab9941263b
@ -9,7 +9,10 @@ use super::{
|
||||
use crate::{
|
||||
events::{IoEvents, Observer},
|
||||
prelude::*,
|
||||
process::{signal::Poller, Gid, Uid},
|
||||
process::{
|
||||
signal::{Pollable, Poller},
|
||||
Gid, Uid,
|
||||
},
|
||||
time::clocks::RealTimeCoarseClock,
|
||||
};
|
||||
|
||||
@ -23,15 +26,17 @@ impl PipeReader {
|
||||
}
|
||||
}
|
||||
|
||||
impl Pollable for PipeReader {
|
||||
fn poll(&self, mask: IoEvents, poller: Option<&Poller>) -> IoEvents {
|
||||
self.consumer.poll(mask, poller)
|
||||
}
|
||||
}
|
||||
|
||||
impl FileLike for PipeReader {
|
||||
fn read(&self, buf: &mut [u8]) -> Result<usize> {
|
||||
self.consumer.read(buf)
|
||||
}
|
||||
|
||||
fn poll(&self, mask: IoEvents, poller: Option<&Poller>) -> IoEvents {
|
||||
self.consumer.poll(mask, poller)
|
||||
}
|
||||
|
||||
fn status_flags(&self) -> StatusFlags {
|
||||
self.consumer.status_flags()
|
||||
}
|
||||
@ -90,15 +95,17 @@ impl PipeWriter {
|
||||
}
|
||||
}
|
||||
|
||||
impl Pollable for PipeWriter {
|
||||
fn poll(&self, mask: IoEvents, poller: Option<&Poller>) -> IoEvents {
|
||||
self.producer.poll(mask, poller)
|
||||
}
|
||||
}
|
||||
|
||||
impl FileLike for PipeWriter {
|
||||
fn write(&self, buf: &[u8]) -> Result<usize> {
|
||||
self.producer.write(buf)
|
||||
}
|
||||
|
||||
fn poll(&self, mask: IoEvents, poller: Option<&Poller>) -> IoEvents {
|
||||
self.producer.poll(mask, poller)
|
||||
}
|
||||
|
||||
fn status_flags(&self) -> StatusFlags {
|
||||
self.producer.status_flags()
|
||||
}
|
||||
|
Reference in New Issue
Block a user