aboutsummaryrefslogtreecommitdiff
path: root/book/en/src/by-example
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-10-07 04:38:51 +0000
committerGitHub <noreply@github.com>2020-10-07 04:38:51 +0000
commit593dbeb9bf8b9e242793b6739d4076f20ee6cc6b (patch)
treefd23ecfb49b37a7ab3134bafdc2b4bfe8ba97a65 /book/en/src/by-example
parentb1e1abae29591e50ebf345a2bd249a73e564cea9 (diff)
parent987332b831761a681ec5cdda192ead524438df77 (diff)
Merge #385
385: Doclints r=korken89 a=dcarosone Some minor doc lints and wording cleanup Co-authored-by: Daniel Carosone <Daniel.Carosone@gmail.com>
Diffstat (limited to 'book/en/src/by-example')
-rw-r--r--book/en/src/by-example/resources.md6
-rw-r--r--book/en/src/by-example/tips.md1
2 files changed, 5 insertions, 2 deletions
diff --git a/book/en/src/by-example/resources.md b/book/en/src/by-example/resources.md
index d082dfc..9d90fbe 100644
--- a/book/en/src/by-example/resources.md
+++ b/book/en/src/by-example/resources.md
@@ -1,4 +1,4 @@
-## Resources
+# Resources
The framework provides an abstraction to share data between any of the contexts
we saw in the previous section (task handlers, `init` and `idle`): resources.
@@ -116,7 +116,9 @@ are required to access the resource even if the resource is contended by several
tasks running at different priorities. The downside is that the task only gets a
shared reference (`&-`) to the resource, limiting the operations it can perform
on it, but where a shared reference is enough this approach reduces the number
-of required locks.
+of required locks. In addition to simple immutable data, this shared access can
+be useful where the resource type safely implements interior mutability, with
+appropriate locking or atomic operations of its own.
Note that in this release of RTIC it is not possible to request both exclusive
access (`&mut-`) and shared access (`&-`) to the *same* resource from different
diff --git a/book/en/src/by-example/tips.md b/book/en/src/by-example/tips.md
index d8264c9..090b30a 100644
--- a/book/en/src/by-example/tips.md
+++ b/book/en/src/by-example/tips.md
@@ -116,6 +116,7 @@ Here's an example where `heapless::Pool` is used to "box" buffers of 128 bytes.
``` rust
{{#include ../../../../examples/pool.rs}}
```
+
``` console
$ cargo run --example pool
{{#include ../../../../ci/expected/pool.run}}