Add exit to example

This commit is contained in:
Albin Hedman 2025-10-19 23:50:12 +02:00
parent f5e86943a6
commit 09598ad9e9

View file

@ -25,18 +25,12 @@ mod app {
async fn task1(cx: task1::Context) {
hprintln!("Hello from task1!");
cx.local_spawner.task2(Default::default()).unwrap();
cx.local_spawner.task3(Default::default()).unwrap();
}
#[task(priority = 1, local_task = true)]
async fn task2(_cx: task2::Context, _nsns: NotSendNotSync) {
hprintln!("Hello from task2!");
}
// The value of `local_task` may be omitted and is in that case interpreted as `true`
#[task(priority = 1, local_task)]
async fn task3(_cx: task3::Context, _nsns: NotSendNotSync) {
hprintln!("Hello from task3!");
debug::exit(debug::EXIT_SUCCESS); // Exit QEMU simulator
}
}