From fde331fdf9133ae543048becfb5d8869cb7dd6b7 Mon Sep 17 00:00:00 2001 From: Per Lindgren Date: Wed, 27 Oct 2021 13:45:37 +0200 Subject: [PATCH] CI problem fixed --- ci/expected/lockall.run | 2 -- .../{lockall_destcruct.run => lockall_destruct.run} | 2 -- examples/lockall.rs | 2 -- examples/lockall_destruct.rs | 8 +++----- 4 files changed, 3 insertions(+), 11 deletions(-) rename ci/expected/{lockall_destcruct.run => lockall_destruct.run} (50%) diff --git a/ci/expected/lockall.run b/ci/expected/lockall.run index 4581e91551..77ae8a1d90 100644 --- a/ci/expected/lockall.run +++ b/ci/expected/lockall.run @@ -1,5 +1,3 @@ foo: a = 1, b = 2 baz -still in foo::lock bar: a = 3 -still in foo diff --git a/ci/expected/lockall_destcruct.run b/ci/expected/lockall_destruct.run similarity index 50% rename from ci/expected/lockall_destcruct.run rename to ci/expected/lockall_destruct.run index 4581e91551..77ae8a1d90 100644 --- a/ci/expected/lockall_destcruct.run +++ b/ci/expected/lockall_destruct.run @@ -1,5 +1,3 @@ foo: a = 1, b = 2 baz -still in foo::lock bar: a = 3 -still in foo diff --git a/examples/lockall.rs b/examples/lockall.rs index 01f4977a20..5f0288495f 100644 --- a/examples/lockall.rs +++ b/examples/lockall.rs @@ -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 } diff --git a/examples/lockall_destruct.rs b/examples/lockall_destruct.rs index aab25bcef2..bf6bb005ef 100644 --- a/examples/lockall_destruct.rs +++ b/examples/lockall_destruct.rs @@ -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();