aboutsummaryrefslogtreecommitdiff
path: root/examples/task.rs
diff options
context:
space:
mode:
authorGravatar Jorge Aparicio <jorge@japaric.io> 2019-08-21 10:17:27 +0200
committerGravatar Jorge Aparicio <jorge@japaric.io> 2019-08-21 10:17:27 +0200
commit07b2b4d83078d0fd260d5f0812e8d5a34d02b793 (patch)
treedba2a8e8316e8cd868ccb7b46a80d63c5f61a224 /examples/task.rs
parent0e146f8d1142672725b6abb38478f503a9261c80 (diff)
downloadrtic-07b2b4d83078d0fd260d5f0812e8d5a34d02b793.tar.gz
rtic-07b2b4d83078d0fd260d5f0812e8d5a34d02b793.tar.zst
rtic-07b2b4d83078d0fd260d5f0812e8d5a34d02b793.zip
doc up
Diffstat (limited to 'examples/task.rs')
-rw-r--r--examples/task.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/task.rs b/examples/task.rs
index 43f7e569..9e563d71 100644
--- a/examples/task.rs
+++ b/examples/task.rs
@@ -17,16 +17,20 @@ const APP: () = {
#[task(spawn = [bar, baz])]
fn foo(c: foo::Context) {
- hprintln!("foo").unwrap();
+ hprintln!("foo - start").unwrap();
// spawns `bar` onto the task scheduler
// `foo` and `bar` have the same priority so `bar` will not run until
// after `foo` terminates
c.spawn.bar().unwrap();
+ hprintln!("foo - middle").unwrap();
+
// spawns `baz` onto the task scheduler
// `baz` has higher priority than `foo` so it immediately preempts `foo`
c.spawn.baz().unwrap();
+
+ hprintln!("foo - end").unwrap();
}
#[task]