aboutsummaryrefslogtreecommitdiff
path: root/examples/preemption.rs
diff options
context:
space:
mode:
authorJorge Aparicio <jorge@japaric.io>2017-07-27 22:40:47 -0500
committerJorge Aparicio <jorge@japaric.io>2017-07-27 22:40:47 -0500
commite85d6e53c89cd1ea1da8826778c5a74154fb651d (patch)
tree76fbc30063df22724b9b160c85055e1d294513b0 /examples/preemption.rs
parent271df39bdba0690ea7ba77a6ff5d8d7edb9b8036 (diff)
update examples
Diffstat (limited to 'examples/preemption.rs')
-rw-r--r--examples/preemption.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/preemption.rs b/examples/preemption.rs
index 057e4fd..256b9bd 100644
--- a/examples/preemption.rs
+++ b/examples/preemption.rs
@@ -1,4 +1,4 @@
-//! Two tasks running at different priorities with access to the same resource
+//! Two tasks running at *different* priorities with access to the same resource
#![deny(unsafe_code)]
#![feature(const_fn)]
#![feature(proc_macro)]
@@ -17,7 +17,7 @@ app! {
},
tasks: {
- // the task `SYS_TICK` has higher priority than `TIM2`
+ // The `SYS_TICK` task has higher priority than `TIM2`
SYS_TICK: {
path: sys_tick,
priority: 2,
@@ -45,7 +45,7 @@ fn idle() -> ! {
fn sys_tick(_t: &mut Threshold, r: SYS_TICK::Resources) {
// ..
- // this task can't be preempted by `tim2` so it has direct access to the
+ // This task can't be preempted by `tim2` so it has direct access to the
// resource data
**r.COUNTER += 1;
@@ -55,10 +55,10 @@ fn sys_tick(_t: &mut Threshold, r: SYS_TICK::Resources) {
fn tim2(t: &mut Threshold, mut r: TIM2::Resources) {
// ..
- // as this task runs at lower priority it needs a critical section to
+ // As this task runs at lower priority it needs a critical section to
// prevent `sys_tick` from preempting it while it modifies this resource
// data. The critical section is required to prevent data races which can
- // lead to data corruption or data loss
+ // lead to undefined behavior
r.COUNTER.claim_mut(t, |counter, _t| { **counter += 1; });
// ..