unqueue tasks when a scope is dropped
This commit is contained in:
1 parent
701093ede5
commit
d28221bdc2
4 files changed
+21
-18
No files matched your search
@@ -6,6 +6,7 @@ use crate::{
|
||||
};
|
||||
use std::{
|
||||
cell::{Cell, Ref, RefCell},
|
||||
collections::VecDeque,
|
||||
rc::Rc,
|
||||
};
|
||||
|
||||
@@ -28,6 +29,9 @@ pub struct Runtime {
|
||||
/// Tasks created with cx.spawn
|
||||
pub(crate) tasks: RefCell<slab::Slab<LocalTask>>,
|
||||
|
||||
/// Queued tasks that are waiting to be polled
|
||||
pub(crate) queued_tasks: Rc<RefCell<VecDeque<Task>>>,
|
||||
|
||||
pub(crate) sender: futures_channel::mpsc::UnboundedSender<SchedulerMsg>,
|
||||
}
|
||||
|
||||
@@ -40,6 +44,7 @@ impl Runtime {
|
||||
scope_stack: Default::default(),
|
||||
current_task: Default::default(),
|
||||
tasks: Default::default(),
|
||||
queued_tasks: Rc::new(RefCell::new(VecDeque::new())),
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user