mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-22 06:42:32 +00:00
Allow spawning tasks with non-copy args.
This commit is contained in:
parent
0a3590566d
commit
b40e09d502
@ -93,7 +93,7 @@ pub fn task(args: TokenStream, item: TokenStream) -> TokenStream {
|
||||
#task_fn
|
||||
type F = impl ::core::future::Future + 'static;
|
||||
static POOL: [::embassy::executor::Task<F>; #pool_size] = [::embassy::executor::Task::new(); #pool_size];
|
||||
unsafe { ::embassy::executor::Task::spawn(&POOL, || task(#arg_names)) }
|
||||
unsafe { ::embassy::executor::Task::spawn(&POOL, move || task(#arg_names)) }
|
||||
}
|
||||
};
|
||||
result.into()
|
||||
|
Loading…
Reference in New Issue
Block a user