Cleanup warnings

Implement interrupt on signal in pipe:
This commit is contained in:
Jeremy Soller
2017-10-21 20:30:20 -06:00
parent 31d742e6be
commit 51339cb8c9
18 changed files with 125 additions and 91 deletions

View File

@@ -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() }
}
}

View File

@@ -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();
}
}

View File

@@ -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();
}
}