Skip to content

Commit

Permalink
CI problem fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
perlindgren authored and Henrik Tjäder committed Feb 5, 2022
1 parent 3a24fd8 commit fde331f
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 11 deletions.
2 changes: 0 additions & 2 deletions ci/expected/lockall.run
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
foo: a = 1, b = 2
baz
still in foo::lock
bar: a = 3
still in foo
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
foo: a = 1, b = 2
baz
still in foo::lock
bar: a = 3
still in foo
2 changes: 0 additions & 2 deletions examples/lockall.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ mod app {
*s.a += 1;
bar::spawn().unwrap();
baz::spawn().unwrap();
hprintln!("still in foo::lock").ok();
});
hprintln!("still in foo").ok();
debug::exit(debug::EXIT_SUCCESS); // Exit QEMU simulator
}

Expand Down
8 changes: 3 additions & 5 deletions examples/lockall_destruct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,17 @@ mod app {
**a += 1;
bar::spawn().unwrap();
baz::spawn().unwrap();
hprintln!("still in foo::lock").ok();
});
hprintln!("still in foo").ok();
debug::exit(debug::EXIT_SUCCESS); // Exit QEMU simulator
}

#[task(priority = 2, shared = [a])]
fn bar(mut c: bar::Context) {
// the higher priority task does still need a critical section
let a = c.shared.lock(|s| {
*s.a += 1;
let a = c.shared.lock(|bar::Shared { a }| {
**a += 1;
// *s.b += 1; `b` not accessible
*s.a
**a
});

hprintln!("bar: a = {}", a).unwrap();
Expand Down

0 comments on commit fde331f

Please sign in to comment.