switch from slab to slotmap for tasks to fix that ABA problem (#2488)
This commit is contained in:
1 parent
5024139e01
commit
e4764f2bba
5 files changed
+39
-18
No files matched your search
@@ -1,3 +1,5 @@
|
||||
use slotmap::DefaultKey;
|
||||
|
||||
use crate::innerlude::Effect;
|
||||
use crate::{
|
||||
innerlude::{LocalTask, SchedulerMsg},
|
||||
@@ -27,7 +29,7 @@ pub struct Runtime {
|
||||
pub(crate) current_task: Cell<Option<Task>>,
|
||||
|
||||
/// Tasks created with cx.spawn
|
||||
pub(crate) tasks: RefCell<slab::Slab<Rc<LocalTask>>>,
|
||||
pub(crate) tasks: RefCell<slotmap::SlotMap<DefaultKey, Rc<LocalTask>>>,
|
||||
|
||||
// Currently suspended tasks
|
||||
pub(crate) suspended_tasks: Cell<usize>,
|
||||
|
||||
Reference in new issue
Block a user