mirror of
https://github.com/rtic-rs/rtic.git
synced 2024-11-29 06:54:33 +01:00
RacyCell inputs
This commit is contained in:
parent
0dc2d52918
commit
c70191c019
3 changed files with 8 additions and 3 deletions
|
@ -86,7 +86,11 @@ pub fn codegen(app: &App, analysis: &Analysis, _extra: &Extra) -> Vec<TokenStrea
|
|||
#(#cfgs)*
|
||||
#t::#name => {
|
||||
let #tupled =
|
||||
#inputs.get_unchecked(usize::from(index)).as_ptr().read();
|
||||
#inputs
|
||||
.get_mut_unchecked()
|
||||
.get_unchecked(usize::from(index))
|
||||
.as_ptr()
|
||||
.read();
|
||||
#fq.get_mut_unchecked().split().0.enqueue_unchecked(index);
|
||||
let priority = &rtic::export::Priority::new(PRIORITY);
|
||||
#app_path::#name(
|
||||
|
|
|
@ -210,6 +210,7 @@ pub fn codegen(
|
|||
unsafe {
|
||||
if let Some(index) = rtic::export::interrupt::free(|_| #app_path::#fq.get_mut_unchecked().dequeue()) {
|
||||
#app_path::#inputs
|
||||
.get_mut_unchecked()
|
||||
.get_unchecked_mut(usize::from(index))
|
||||
.as_mut_ptr()
|
||||
.write(input);
|
||||
|
|
|
@ -82,8 +82,8 @@ pub fn codegen(
|
|||
#uninit
|
||||
// /// Buffer that holds the inputs of a task
|
||||
#[doc(hidden)]
|
||||
static mut #inputs_ident: [core::mem::MaybeUninit<#input_ty>; #cap_lit] =
|
||||
[#(#elems,)*];
|
||||
static #inputs_ident: rtic::RacyCell<[core::mem::MaybeUninit<#input_ty>; #cap_lit]> =
|
||||
rtic::RacyCell::new([#(#elems,)*]);
|
||||
));
|
||||
|
||||
// `${task}Resources`
|
||||
|
|
Loading…
Reference in a new issue