Make Task require Send

This commit is contained in:
Anthony Ramine 2017-09-20 09:40:53 +02:00
parent 8000efac75
commit f088b708c9
10 changed files with 25 additions and 21 deletions

View file

@ -20,9 +20,12 @@ pub trait TaskSource {
canceller: &TaskCanceller,
) -> Result<(), ()>
where
T: Send + Task + 'static;
T: Task + 'static;
fn queue<T: Task + Send + 'static>(&self, msg: Box<T>, global: &GlobalScope) -> Result<(), ()> {
fn queue<T>(&self, msg: Box<T>, global: &GlobalScope) -> Result<(), ()>
where
T: Task + 'static,
{
self.queue_with_canceller(msg, &global.task_canceller())
}
}