diff options
| author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-10-23 20:52:58 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-23 20:52:58 +0000 |
| commit | bbcae14e37c5f4ab5701b2a688bee52bfa7aaa1b (patch) | |
| tree | c70a80e9bcacb54838f09141bd1d2b27e844760f /examples/late.rs | |
| parent | b3aa9e99a975eca637582f31de20fe11ae8f7d64 (diff) | |
| parent | e8eca4be37a2fe1af25b203ace5e99b31fcc3972 (diff) | |
Merge #399
399: Now all locks are symmetric r=AfoHT a=korken89
Co-authored-by: Emil Fresk <emil.fresk@gmail.com>
Diffstat (limited to 'examples/late.rs')
| -rw-r--r-- | examples/late.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/late.rs b/examples/late.rs index d20a69c..d4efaba 100644 --- a/examples/late.rs +++ b/examples/late.rs @@ -35,9 +35,9 @@ mod app { } #[idle(resources = [c])] - fn idle(c: idle::Context) -> ! { + fn idle(mut c: idle::Context) -> ! { loop { - if let Some(byte) = c.resources.c.dequeue() { + if let Some(byte) = c.resources.c.lock(|c| c.dequeue()) { hprintln!("received message: {}", byte).unwrap(); debug::exit(debug::EXIT_SUCCESS); @@ -48,7 +48,7 @@ mod app { } #[task(binds = UART0, resources = [p])] - fn uart0(c: uart0::Context) { - c.resources.p.enqueue(42).unwrap(); + fn uart0(mut c: uart0::Context) { + c.resources.p.lock(|p| p.enqueue(42).unwrap()); } } |
