get_ref -> get_mut
This commit is contained in:
parent
965fdb0294
commit
dd593d3ab8
1 changed files with 8 additions and 8 deletions
|
@ -173,26 +173,26 @@ impl ReentrantMutex {
|
|||
|
||||
pub unsafe fn lock(&self) {
|
||||
// `init` must have been called, so this is now initialized and
|
||||
// we can call `get_ref`.
|
||||
c::EnterCriticalSection((&mut *self.inner.get()).get_ref());
|
||||
// we can call `get_mut`.
|
||||
c::EnterCriticalSection((&mut *self.inner.get()).get_mut());
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub unsafe fn try_lock(&self) -> bool {
|
||||
// `init` must have been called, so this is now initialized and
|
||||
// we can call `get_ref`.
|
||||
c::TryEnterCriticalSection((&mut *self.inner.get()).get_ref()) != 0
|
||||
// we can call `get_mut`.
|
||||
c::TryEnterCriticalSection((&mut *self.inner.get()).get_mut()) != 0
|
||||
}
|
||||
|
||||
pub unsafe fn unlock(&self) {
|
||||
// `init` must have been called, so this is now initialized and
|
||||
// we can call `get_ref`.
|
||||
c::LeaveCriticalSection((&mut *self.inner.get()).get_ref());
|
||||
// we can call `get_mut`.
|
||||
c::LeaveCriticalSection((&mut *self.inner.get()).get_mut());
|
||||
}
|
||||
|
||||
pub unsafe fn destroy(&self) {
|
||||
// `init` must have been called, so this is now initialized and
|
||||
// we can call `get_ref`.
|
||||
c::DeleteCriticalSection((&mut *self.inner.get()).get_ref());
|
||||
// we can call `get_mut`.
|
||||
c::DeleteCriticalSection((&mut *self.inner.get()).get_mut());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue