mirror of
https://github.com/rtic-rs/rtic.git
synced 2024-11-23 20:22:51 +01:00
CI problem fixed
This commit is contained in:
parent
3a24fd8bd1
commit
fde331fdf9
4 changed files with 3 additions and 11 deletions
|
@ -1,5 +1,3 @@
|
|||
foo: a = 1, b = 2
|
||||
baz
|
||||
still in foo::lock
|
||||
bar: a = 3
|
||||
still in foo
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
foo: a = 1, b = 2
|
||||
baz
|
||||
still in foo::lock
|
||||
bar: a = 3
|
||||
still in foo
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue