diff options
| author | Jorge Aparicio <jorge@japaric.io> | 2017-05-08 12:05:42 -0500 |
|---|---|---|
| committer | Jorge Aparicio <jorge@japaric.io> | 2017-05-08 12:05:42 -0500 |
| commit | fc4cb7d472dad1ea0fa137bb116bd907efc19601 (patch) | |
| tree | dd3e462f3fa683ed26c2f6dcd4a2d8be504231c7 /tests/cfail/race-2.rs | |
| parent | 2063697c626a7547f5d9fb140fbc7eb9773a5120 (diff) | |
replace the ceiling token with a preemption threshold token
Diffstat (limited to 'tests/cfail/race-2.rs')
| -rw-r--r-- | tests/cfail/race-2.rs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/cfail/race-2.rs b/tests/cfail/race-2.rs index 402a483..f44856e 100644 --- a/tests/cfail/race-2.rs +++ b/tests/cfail/race-2.rs @@ -1,14 +1,14 @@ extern crate cortex_m_rtfm as rtfm; -use rtfm::{C1, C2, C3, C4, P1, P3, Resource}; +use rtfm::{C2, C4, P1, P3, Resource, T1, T3}; static R1: Resource<i32, C2> = Resource::new(0); static R2: Resource<i32, C4> = 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); @@ -16,12 +16,12 @@ fn j1(prio: P1, ceil: C1) { ); } -fn j2(_task: Task, prio: P3, ceil: C3) { - ceil.raise( - &R2, |ceil| { - // OK C2 (R1's ceiling) <= C4 (system ceiling) +fn j2(_task: Task, prio: P3, thr: T3) { + thr.raise( + &R2, |thr| { + // OK C2 (R1's ceiling) <= T4 (preemption threshold) // BAD C2 (R1's ceiling) < P3 (j2's priority) - let r1 = R1.access(&prio, ceil); + let r1 = R1.access(&prio, thr); //~^ error } ); |
