aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index dfc5e52..7b170fc 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -83,6 +83,19 @@ where
unsafe { &*self.data.get() }
}
+ /// Like [Resource.claim](struct.Resource.html#method.claim) but returns a
+ /// `&mut-` reference
+ pub fn claim_mut<'task, PRIORITY>(
+ &'static self,
+ _priority: &'task mut P<PRIORITY>,
+ ) -> &'task mut T
+ where
+ CEILING: Cmp<PRIORITY, Output = Equal>,
+ P<PRIORITY>: Priority,
+ {
+ unsafe { &mut *self.data.get() }
+ }
+
/// Locks the resource for the duration of the critical section `f`
///
/// For the duration of the critical section, tasks whose priority level is