diff options
| author | Jorge Aparicio <japaricious@gmail.com> | 2017-04-12 10:43:36 -0500 |
|---|---|---|
| committer | Jorge Aparicio <japaricious@gmail.com> | 2017-04-12 10:43:36 -0500 |
| commit | fb20b5152822462de2b5482f590c8f18078ec70b (patch) | |
| tree | 5a5aa2cb55ce0705fcab688c1e77f4351df53107 /src | |
| parent | d9300f01f8caf619c65de15f2bbe76672bde9980 (diff) | |
add `claim_mut`
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib.rs | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -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 |
