aboutsummaryrefslogtreecommitdiff
path: root/tests/cfail/race-1.rs
diff options
context:
space:
mode:
authorJorge Aparicio <jorge@japaric.io>2017-05-08 12:05:42 -0500
committerJorge Aparicio <jorge@japaric.io>2017-05-08 12:05:42 -0500
commitfc4cb7d472dad1ea0fa137bb116bd907efc19601 (patch)
treedd3e462f3fa683ed26c2f6dcd4a2d8be504231c7 /tests/cfail/race-1.rs
parent2063697c626a7547f5d9fb140fbc7eb9773a5120 (diff)
replace the ceiling token with a preemption threshold token
Diffstat (limited to 'tests/cfail/race-1.rs')
-rw-r--r--tests/cfail/race-1.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/cfail/race-1.rs b/tests/cfail/race-1.rs
index 167802d..8d32c42 100644
--- a/tests/cfail/race-1.rs
+++ b/tests/cfail/race-1.rs
@@ -1,13 +1,13 @@
extern crate cortex_m_rtfm as rtfm;
-use rtfm::{C1, C2, C3, C4, P1, P3, Resource};
+use rtfm::{C2, P1, P3, Resource, T1, T3};
static R1: Resource<i32, C2> = Resource::new(0);
-fn j1(prio: P1, ceil: C1) {
- ceil.raise(
- &R1, |ceil| {
- let r1 = R1.access(&prio, ceil);
+fn j1(prio: P1, thr: T1) {
+ thr.raise(
+ &R1, |thr| {
+ let r1 = R1.access(&prio, thr);
// `j2` preempts this critical section
rtfm::request(j2);
@@ -15,12 +15,12 @@ fn j1(prio: P1, ceil: C1) {
);
}
-fn j2(_task: Task, prio: P3, ceil: C3) {
+fn j2(_task: Task, prio: P3, thr: T3) {
rtfm::atomic(
- |ceil| {
- // OK C2 (R1's ceiling) <= C16 (system ceiling)
+ |thr| {
+ // OK C2 (R1's ceiling) <= T16 (preemption threshold)
// BAD C2 (R1's ceiling) < P3 (j2's priority)
- let r1 = R1.access(&prio, &ceil);
+ let r1 = R1.access(&prio, &thr);
//~^ error
},
);