diff options
| author | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-11-04 18:58:45 +0000 |
|---|---|---|
| committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-11-04 18:58:45 +0000 |
| commit | 8a27efeaeb5483dc12370add4b3786bdd20a4973 (patch) | |
| tree | 00e10c34cc22f80aee45c51d945e31c237c74eeb /tests/cpass/resource.rs | |
| parent | 16d473a9b6827aa7ffa9ce92e4e532eff9a091d2 (diff) | |
| parent | a2792182952c953aab2c442bb02ac1f2e4986e67 (diff) | |
Merge #99
99: impl Mutex on all shared resources r=japaric a=japaric
document how to write generic code that operates on resources
Co-authored-by: Jorge Aparicio <jorge@japaric.io>
Diffstat (limited to 'tests/cpass/resource.rs')
| -rw-r--r-- | tests/cpass/resource.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/cpass/resource.rs b/tests/cpass/resource.rs index 6a7a873..5718a4a 100644 --- a/tests/cpass/resource.rs +++ b/tests/cpass/resource.rs @@ -8,7 +8,7 @@ extern crate lm3s6965; extern crate panic_halt; extern crate rtfm; -use rtfm::app; +use rtfm::{app, Exclusive}; #[app(device = lm3s6965)] const APP: () = { @@ -59,11 +59,11 @@ const APP: () = { // owned by interrupt == `&mut` let _: &mut u32 = resources.O3; - // no `Mutex` when access from highest priority task - let _: &mut u32 = resources.S1; + // no `Mutex` proxy when access from highest priority task + let _: Exclusive<u32> = resources.S1; - // no `Mutex` when co-owned by cooperative (same priority) tasks - let _: &mut u32 = resources.S2; + // no `Mutex` proxy when co-owned by cooperative (same priority) tasks + let _: Exclusive<u32> = resources.S2; // `&` if read-only let _: &u32 = resources.S3; @@ -74,7 +74,7 @@ const APP: () = { // owned by interrupt == `&` if read-only let _: &u32 = resources.O5; - // no `Mutex` when co-owned by cooperative (same priority) tasks - let _: &mut u32 = resources.S2; + // no `Mutex` proxy when co-owned by cooperative (same priority) tasks + let _: Exclusive<u32> = resources.S2; } }; |
