Cleanup warnings
Implement interrupt on signal in pipe:
This commit is contained in:
@@ -2,7 +2,7 @@ use alloc::arc::Arc;
|
||||
use collections::Vec;
|
||||
use spin::{Mutex, RwLock};
|
||||
|
||||
use context::{self, Context};
|
||||
use context::{self, Context, SwitchResult};
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct WaitCondition {
|
||||
@@ -25,7 +25,7 @@ impl WaitCondition {
|
||||
len
|
||||
}
|
||||
|
||||
pub fn wait(&self) {
|
||||
pub fn wait(&self) -> SwitchResult {
|
||||
{
|
||||
let context_lock = {
|
||||
let contexts = context::contexts();
|
||||
@@ -37,7 +37,8 @@ impl WaitCondition {
|
||||
|
||||
self.contexts.lock().push(context_lock);
|
||||
}
|
||||
unsafe { context::switch(); }
|
||||
|
||||
unsafe { context::switch() }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ impl<K, V> WaitMap<K, V> where K: Clone + Ord {
|
||||
if let Some(value) = self.receive_nonblock(key) {
|
||||
return value;
|
||||
}
|
||||
self.condition.wait();
|
||||
let _ = self.condition.wait();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ impl<K, V> WaitMap<K, V> where K: Clone + Ord {
|
||||
if let Some(entry) = self.receive_any_nonblock() {
|
||||
return entry;
|
||||
}
|
||||
self.condition.wait();
|
||||
let _ = self.condition.wait();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ impl<T> WaitQueue<T> {
|
||||
if let Some(value) = self.inner.lock().pop_front() {
|
||||
return value;
|
||||
}
|
||||
self.condition.wait();
|
||||
let _ = self.condition.wait();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user