File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ impl<F: Future<Output = ()> + Unpin + 'static> ExecutorRuntime<F> {
68
68
// 添加一个task,它的初始状态是notified,也就是说它可以被执行.
69
69
fn add_task ( & self , priority : usize , future : F ) -> u64 {
70
70
assert ! ( priority < MAX_PRIORITY ) ;
71
- let key = self . task_collection . priority_insert ( priority, future) ;
71
+ let key = self . task_collection . priority_add_task ( priority, future) ;
72
72
key
73
73
}
74
74
Original file line number Diff line number Diff line change @@ -143,11 +143,11 @@ impl<F: Future<Output = ()> + Unpin + 'static> TaskCollection<F> {
143
143
}
144
144
145
145
// 插入一个Future, 其优先级为 DEFAULT_PRIORITY
146
- pub fn insert ( & self , future : F ) -> u64 {
147
- self . priority_insert ( DEFAULT_PRIORITY , future)
146
+ pub fn add_task ( & self , future : F ) -> u64 {
147
+ self . priority_add_task ( DEFAULT_PRIORITY , future)
148
148
}
149
149
150
- pub fn priority_insert ( & self , priority : usize , future : F ) -> u64 {
150
+ pub fn priority_add_task ( & self , priority : usize , future : F ) -> u64 {
151
151
assert ! ( priority < MAX_PRIORITY ) ;
152
152
let key = self . inners [ priority] . borrow_mut ( ) . insert ( future) ;
153
153
assert ! ( key < TASK_NUM_PER_PRIORITY ) ;
You can’t perform that action at this time.
0 commit comments