Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Commit be1bc6c

Browse files
committed
Document SchedulingStateMachine::schedule_task()
1 parent 5887a91 commit be1bc6c

File tree

1 file changed

+7
-0
lines changed
  • unified-scheduler-logic/src

1 file changed

+7
-0
lines changed

unified-scheduler-logic/src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,13 @@ impl SchedulingStateMachine {
512512
self.total_task_count.current()
513513
}
514514

515+
/// Schedules given `task`, returning it if successful.
516+
///
517+
/// Returns `Some(task)` if it's immediately scheduled. Otherwise, returns `None`,
518+
/// indicating the task is blocked currently.
519+
///
520+
/// Note that this function's type signature is intentionally redundant to take the ownership
521+
/// of given task _conditionally_ for future optimization.
515522
#[must_use]
516523
pub fn schedule_task(&mut self, task: Task) -> Option<Task> {
517524
let new_task_index = task.task_index();

0 commit comments

Comments
 (0)