Add spawn/spawn_pool APIs to Task
This commit is contained in:
@ -105,7 +105,7 @@ pub fn task(args: TokenStream, item: TokenStream) -> TokenStream {
|
||||
type F = #impl_ty;
|
||||
const NEW_TASK: Task<F> = Task::new();
|
||||
static POOL: [Task<F>; #pool_size] = [NEW_TASK; #pool_size];
|
||||
unsafe { Task::spawn(&POOL, move || task(#arg_names)) }
|
||||
unsafe { Task::spawn_pool(&POOL, move || task(#arg_names)) }
|
||||
}
|
||||
};
|
||||
result.into()
|
||||
|
Reference in New Issue
Block a user