fix (cross-core) initialization barriers

This commit is contained in:
Jorge Aparicio 2019-07-03 20:36:52 +02:00
parent be92041a59
commit 14d63f4961

View file

@ -25,8 +25,12 @@ pub fn codegen(
if analysis.timer_queues.is_empty() {
// cross-initialization barriers -- notify *other* cores that their resources have been
// initialized
if analysis.initialization_barriers.contains_key(&core) {
let ib = util::init_barrier(core);
for (user, initializers) in &analysis.initialization_barriers {
if !initializers.contains(&core) {
continue;
}
let ib = util::init_barrier(*user);
let shared = if cfg!(feature = "heterogeneous") {
Some(quote!(
#[rtfm::export::shared]
@ -46,15 +50,13 @@ pub fn codegen(
}
// then wait until the other cores have initialized *our* resources
for (&initializer, users) in &analysis.initialization_barriers {
if users.contains(&core) {
let ib = util::init_barrier(initializer);
if analysis.initialization_barriers.contains_key(&core) {
let ib = util::init_barrier(core);
stmts.push(quote!(
#ib.wait();
));
}
}
// cross-spawn barriers: wait until other cores are ready to receive messages
for (&receiver, senders) in &analysis.spawn_barriers {