pub fn yield_now() -> impl Future<Output = ()>
Expand description

Yields execution of the current task so that other tasks may execute.

The task continues to be in a “runnable” state though, so it will eventually run again.

Examples

use kernel::kasync::yield_now;

async fn example() {
    pr_info!("Before yield\n");
    yield_now().await;
    pr_info!("After yield\n");
}
This documentation is an old archive. Please see https://rust.docs.kernel.org instead.