mirror of
https://github.com/rtic-rs/rtic.git
synced 2024-11-23 20:22:51 +01:00
fix (cross-core) initialization barriers
This commit is contained in:
parent
be92041a59
commit
14d63f4961
1 changed files with 11 additions and 9 deletions
|
@ -25,8 +25,12 @@ pub fn codegen(
|
||||||
if analysis.timer_queues.is_empty() {
|
if analysis.timer_queues.is_empty() {
|
||||||
// cross-initialization barriers -- notify *other* cores that their resources have been
|
// cross-initialization barriers -- notify *other* cores that their resources have been
|
||||||
// initialized
|
// initialized
|
||||||
if analysis.initialization_barriers.contains_key(&core) {
|
for (user, initializers) in &analysis.initialization_barriers {
|
||||||
let ib = util::init_barrier(core);
|
if !initializers.contains(&core) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
let ib = util::init_barrier(*user);
|
||||||
let shared = if cfg!(feature = "heterogeneous") {
|
let shared = if cfg!(feature = "heterogeneous") {
|
||||||
Some(quote!(
|
Some(quote!(
|
||||||
#[rtfm::export::shared]
|
#[rtfm::export::shared]
|
||||||
|
@ -46,15 +50,13 @@ pub fn codegen(
|
||||||
}
|
}
|
||||||
|
|
||||||
// then wait until the other cores have initialized *our* resources
|
// then wait until the other cores have initialized *our* resources
|
||||||
for (&initializer, users) in &analysis.initialization_barriers {
|
if analysis.initialization_barriers.contains_key(&core) {
|
||||||
if users.contains(&core) {
|
let ib = util::init_barrier(core);
|
||||||
let ib = util::init_barrier(initializer);
|
|
||||||
|
|
||||||
stmts.push(quote!(
|
stmts.push(quote!(
|
||||||
#ib.wait();
|
#ib.wait();
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// cross-spawn barriers: wait until other cores are ready to receive messages
|
// cross-spawn barriers: wait until other cores are ready to receive messages
|
||||||
for (&receiver, senders) in &analysis.spawn_barriers {
|
for (&receiver, senders) in &analysis.spawn_barriers {
|
||||||
|
|
Loading…
Reference in a new issue