mirror of
https://github.com/rtic-rs/rtic.git
synced 2024-11-27 22:15:07 +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)*
|
#(#cfgs)*
|
||||||
#t::#name => {
|
#t::#name => {
|
||||||
let #tupled =
|
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);
|
#fq.get_mut_unchecked().split().0.enqueue_unchecked(index);
|
||||||
let priority = &rtic::export::Priority::new(PRIORITY);
|
let priority = &rtic::export::Priority::new(PRIORITY);
|
||||||
#app_path::#name(
|
#app_path::#name(
|
||||||
|
|
|
@ -210,6 +210,7 @@ pub fn codegen(
|
||||||
unsafe {
|
unsafe {
|
||||||
if let Some(index) = rtic::export::interrupt::free(|_| #app_path::#fq.get_mut_unchecked().dequeue()) {
|
if let Some(index) = rtic::export::interrupt::free(|_| #app_path::#fq.get_mut_unchecked().dequeue()) {
|
||||||
#app_path::#inputs
|
#app_path::#inputs
|
||||||
|
.get_mut_unchecked()
|
||||||
.get_unchecked_mut(usize::from(index))
|
.get_unchecked_mut(usize::from(index))
|
||||||
.as_mut_ptr()
|
.as_mut_ptr()
|
||||||
.write(input);
|
.write(input);
|
||||||
|
|
|
@ -82,8 +82,8 @@ pub fn codegen(
|
||||||
#uninit
|
#uninit
|
||||||
// /// Buffer that holds the inputs of a task
|
// /// Buffer that holds the inputs of a task
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
static mut #inputs_ident: [core::mem::MaybeUninit<#input_ty>; #cap_lit] =
|
static #inputs_ident: rtic::RacyCell<[core::mem::MaybeUninit<#input_ty>; #cap_lit]> =
|
||||||
[#(#elems,)*];
|
rtic::RacyCell::new([#(#elems,)*]);
|
||||||
));
|
));
|
||||||
|
|
||||||
// `${task}Resources`
|
// `${task}Resources`
|
||||||
|
|
Loading…
Reference in a new issue