diff options
Diffstat (limited to 'monoio/src/task/core.rs')
| -rw-r--r-- | monoio/src/task/core.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/monoio/src/task/core.rs b/monoio/src/task/core.rs index b43633f..e92af77 100644 --- a/monoio/src/task/core.rs +++ b/monoio/src/task/core.rs @@ -12,7 +12,7 @@ use super::{ Schedule, }; -#[repr(C)] +#[repr(C)] // 确保该结构的内存 与 C 语言兼容 pub(crate) struct Cell<T: Future, S> { pub(crate) header: Header, pub(crate) core: Core<T, S>, @@ -40,13 +40,16 @@ pub(crate) struct Header { /// State pub(crate) state: State, /// Table of function pointers for executing actions on the task. + /// 函数表 pub(crate) vtable: &'static Vtable, /// Thread ID(sync: used for wake task on its thread; sync disabled: do checking) + /// 线程ID pub(crate) owner_id: usize, } pub(crate) struct Trailer { /// Consumer task waiting on completion of this task. + /// 唤醒的 Waker pub(crate) waker: UnsafeCell<Option<Waker>>, } |
