aboutsummaryrefslogtreecommitdiff
path: root/examples/cfg.rs
diff options
context:
space:
mode:
authorGravatar Emil Fresk <emil.fresk@gmail.com> 2020-10-22 21:36:32 +0200
committerGravatar Emil Fresk <emil.fresk@gmail.com> 2020-10-23 08:38:18 +0200
commite8eca4be37a2fe1af25b203ace5e99b31fcc3972 (patch)
treec70a80e9bcacb54838f09141bd1d2b27e844760f /examples/cfg.rs
parentb3aa9e99a975eca637582f31de20fe11ae8f7d64 (diff)
downloadrtic-e8eca4be37a2fe1af25b203ace5e99b31fcc3972.tar.gz
rtic-e8eca4be37a2fe1af25b203ace5e99b31fcc3972.tar.zst
rtic-e8eca4be37a2fe1af25b203ace5e99b31fcc3972.zip
Now all locks are symmetric
Test fixes Fix test Fix comment
Diffstat (limited to 'examples/cfg.rs')
-rw-r--r--examples/cfg.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/cfg.rs b/examples/cfg.rs
index f900286b..fae13e5b 100644
--- a/examples/cfg.rs
+++ b/examples/cfg.rs
@@ -38,12 +38,12 @@ mod app {
}
#[task(capacity = 2, resources = [count])]
- fn foo(_cx: foo::Context) {
+ fn foo(mut _cx: foo::Context) {
#[cfg(debug_assertions)]
{
- *_cx.resources.count += 1;
+ _cx.resources.count.lock(|count| *count += 1);
- log::spawn(*_cx.resources.count).unwrap();
+ log::spawn(_cx.resources.count.lock(|count| *count)).unwrap();
}
// this wouldn't compile in `release` mode