mirror of
https://github.com/rtic-rs/rtic.git
synced 2025-12-16 21:05:35 +01:00
raise_to -> Ceiling.raise
This commit is contained in:
parent
3e165f2a42
commit
1c82f1b119
6 changed files with 31 additions and 34 deletions
|
|
@ -12,7 +12,7 @@ static R6: Resource<i32, C2> = Resource::new(0);
|
|||
fn j1(prio: P2) {
|
||||
let ceil = prio.as_ceiling();
|
||||
|
||||
rtfm::raise_to(ceil, &R1, |ceil| {
|
||||
ceil.raise(&R1, |ceil| {
|
||||
// CAN borrow a resource with ceiling C when the current ceiling SC > C
|
||||
let r2 = R2.borrow(&prio, ceil);
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ static R1: Resource<(), C3> = Resource::new(());
|
|||
fn j1(prio: P2) {
|
||||
let ceil = prio.as_ceiling();
|
||||
|
||||
let c3 = rtfm::raise_to(ceil, &R1, |ceil| {
|
||||
let c3 = ceil.raise(&R1, |ceil| {
|
||||
// forbidden: ceiling token can't outlive critical section
|
||||
ceil //~ error
|
||||
});
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ static R1: Resource<i32, C2> = Resource::new(0);
|
|||
fn j1(prio: P3) {
|
||||
let ceil = prio.as_ceiling();
|
||||
|
||||
rtfm::raise_to(ceil, &R1, |ceil| {
|
||||
ceil.raise(&R1, |ceil| {
|
||||
//~^ error
|
||||
});
|
||||
}
|
||||
|
|
@ -18,7 +18,7 @@ fn j1(prio: P3) {
|
|||
fn j2(prio: P2) {
|
||||
let ceil = prio.as_ceiling();
|
||||
|
||||
rtfm::raise_to(ceil, &R1, |_| {});
|
||||
ceil.raise(&R1, |_| {});
|
||||
//~^ error
|
||||
|
||||
// OK
|
||||
|
|
@ -30,7 +30,7 @@ fn j3(prio: P1) {
|
|||
let ceil = prio.as_ceiling();
|
||||
|
||||
// OK
|
||||
rtfm::raise_to(ceil, &R1, |ceil| {
|
||||
ceil.raise(&R1, |ceil| {
|
||||
let r1 = R1.borrow(&prio, ceil);
|
||||
})
|
||||
}
|
||||
|
|
@ -41,7 +41,7 @@ static R2: Resource<i32, C16> = Resource::new(0);
|
|||
fn j4(prio: P1) {
|
||||
let ceil = prio.as_ceiling();
|
||||
|
||||
rtfm::raise_to(ceil, &R2, |ceil| {
|
||||
ceil.raise(&R2, |ceil| {
|
||||
//~^ error
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ static R1: Resource<i32, C2> = Resource::new(0);
|
|||
fn j1(prio: P1) {
|
||||
let ceil = prio.as_ceiling();
|
||||
|
||||
rtfm::raise_to(&ceil, &R1, |ceil| {
|
||||
ceil.raise(&R1, |ceil| {
|
||||
let r1 = R1.borrow(&prio, ceil);
|
||||
|
||||
// Would preempt this critical section
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ static R2: Resource<i32, C4> = Resource::new(0);
|
|||
fn j1(prio: P1) {
|
||||
let ceil = prio.as_ceiling();
|
||||
|
||||
rtfm::raise_to(ceil, &R1, |ceil| {
|
||||
ceil.raise(&R1, |ceil| {
|
||||
let r1 = R1.borrow(&prio, ceil);
|
||||
|
||||
// Would preempt this critical section
|
||||
|
|
@ -19,7 +19,7 @@ fn j1(prio: P1) {
|
|||
fn j2(prio: P3) {
|
||||
let ceil = prio.as_ceiling();
|
||||
|
||||
rtfm::raise_to(ceil, &R2, |ceil| {
|
||||
ceil.raise(&R2, |ceil| {
|
||||
// OK C2 (R1's ceiling) <= C4 (system ceiling)
|
||||
// BAD C2 (R1's ceiling) < P3 (j2's priority)
|
||||
let r1 = R1.borrow(&prio, ceil);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue