Add missing fevent impl for RootScheme.

This commit is contained in:
4lDO2
2024-06-15 12:29:05 +02:00
parent 10714a4659
commit 6aa5ed020e
2 changed files with 11 additions and 2 deletions
+8 -2
View File
@@ -919,8 +919,14 @@ impl UserInner {
Ok(())
}
pub fn fevent(&self, _flags: EventFlags) -> Result<EventFlags> {
Ok(EventFlags::empty())
pub fn fevent(&self, flags: EventFlags) -> Result<EventFlags> {
// TODO: Should the root scheme also suppress events if `flags` does not contain
// `EVENT_READ`?
Ok(if self.todo.is_currently_empty() {
EventFlags::empty()
} else {
EventFlags::EVENT_READ.intersection(flags)
})
}
pub fn fsync(&self) -> Result<()> {
+3
View File
@@ -23,6 +23,9 @@ impl<T> WaitQueue<T> {
condition: WaitCondition::new(),
}
}
pub fn is_currently_empty(&self) -> bool {
self.inner.lock().is_empty()
}
pub fn receive(&self, block: bool, reason: &'static str) -> Result<T> {
loop {