aboutsummaryrefslogtreecommitdiff
path: root/tests/cfail/ceiling.rs
diff options
context:
space:
mode:
authorJorge Aparicio <jorge@japaric.io>2017-07-04 11:26:11 -0500
committerJorge Aparicio <jorge@japaric.io>2017-07-04 11:26:11 -0500
commit86a360a3964ecb04a37c0424c76d7b43a9fd40fe (patch)
treecbf0ebee17a588f8f004bdd27e590ee6c958761b /tests/cfail/ceiling.rs
parent2bf5401439df4494b33ef87201ee013eb1f167e8 (diff)
rtfm! macro take 2
Diffstat (limited to 'tests/cfail/ceiling.rs')
-rw-r--r--tests/cfail/ceiling.rs29
1 files changed, 0 insertions, 29 deletions
diff --git a/tests/cfail/ceiling.rs b/tests/cfail/ceiling.rs
deleted file mode 100644
index 118dbcf..0000000
--- a/tests/cfail/ceiling.rs
+++ /dev/null
@@ -1,29 +0,0 @@
-extern crate cortex_m_rtfm as rtfm;
-
-use rtfm::{C2, C3, P0, P2, Resource, T2};
-
-static R1: Resource<(), C3> = Resource::new(());
-
-fn j1(prio: P2, thr: T2) {
- let t3 = thr.raise(
- &R1, |thr| {
- // forbidden: ceiling token can't outlive the critical section
- thr //~ error
- }
- );
-
- // Would be bad: lockless access to a resource with ceiling = 3
- let r2 = R1.access(&prio, t3);
-}
-
-fn j2(prio: P0) {
- let c16 = rtfm::atomic(
- |c16| {
- // forbidden: ceiling token can't outlive the critical section
- c16 //~ error
- },
- );
-
- // Would be bad: lockless access to a resource with ceiling = 16
- let r1 = R1.access(&prio, c16);
-}