From d6d58b0eb88242cf63724e1420bd29f8a4489916 Mon Sep 17 00:00:00 2001 From: Emil Fresk Date: Tue, 10 Jan 2023 21:03:10 +0100 Subject: Async tasks can now take arguments at spawn again --- examples/async-task.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'examples/async-task.rs') diff --git a/examples/async-task.rs b/examples/async-task.rs index 780bc081..e1ab1432 100644 --- a/examples/async-task.rs +++ b/examples/async-task.rs @@ -27,6 +27,7 @@ mod app { hprintln!("init"); async_task::spawn().unwrap(); + async_task_args::spawn(1, 2).unwrap(); async_task2::spawn().unwrap(); (Shared { a: 0 }, Local {}) @@ -53,6 +54,11 @@ mod app { hprintln!("hello from async"); } + #[task] + async fn async_task_args(_cx: async_task_args::Context, a: u32, b: i32) { + hprintln!("hello from async with args a: {}, b: {}", a, b); + } + #[task(priority = 2, shared = [a])] async fn async_task2(cx: async_task2::Context) { let async_task2::SharedResources { a: _, .. } = cx.shared; -- cgit v1.2.3