in src/runtime/task/mod.rs [64:85]
fn new<F>(f: F, stack_size: usize, id: TaskId, name: Option<String>, clock: VectorClock) -> Self
where
F: FnOnce() + Send + 'static,
{
assert!(id.0 < clock.time.len());
let mut continuation = ContinuationPool::acquire(stack_size);
continuation.initialize(Box::new(f));
let waker = make_waker(id);
let continuation = Rc::new(RefCell::new(continuation));
Self {
id,
state: TaskState::Runnable,
continuation,
clock,
waiter: None,
waker,
woken: false,
detached: false,
name,
local_storage: StorageMap::new(),
}
}