sched_yield

Function sched_yield 

Source
pub fn sched_yield() -> Status
Expand description

Release the processor before the end of the current quantum

§Usage

Allows triggering a schedule() even if not in the process’s central blocking point. This permits to preempt the current job even if the current quantum is reached. This permits to ensure that when coming back from a yield call, the current job quantum is full, giving a well-known time window in which the job will not be preempted by another job.

Calling this syscall do not make the task uneligible, but instead push the task bellow in the Sentry’s scheduler queue. See Senty scheduler documentation for more information.

This syscall never fails. This syscall preempt the current job.

There is no useful check of the syscall return code as it is always Status::Ok.

§Example

sentry_uapi::syscall::sched_yield();