Browse Source

Fix mutex try_lock logic

Wow, not sure how I messed that one up
pull/10/head
Fenrir 7 years ago committed by FenrirWolf
parent
commit
f8aca7b2b1
  1. 8
      ctr-std/src/sys/unix/mutex.rs

8
ctr-std/src/sys/unix/mutex.rs

@ -46,8 +46,8 @@ impl Mutex {
#[inline] #[inline]
pub unsafe fn try_lock(&self) -> bool { pub unsafe fn try_lock(&self) -> bool {
match ::libctru::LightLock_TryLock(self.inner.get()) { match ::libctru::LightLock_TryLock(self.inner.get()) {
0 => true, 0 => false,
_ => false, _ => true,
} }
} }
@ -77,8 +77,8 @@ impl ReentrantMutex {
#[inline] #[inline]
pub unsafe fn try_lock(&self) -> bool { pub unsafe fn try_lock(&self) -> bool {
match ::libctru::RecursiveLock_TryLock(self.inner.get()) { match ::libctru::RecursiveLock_TryLock(self.inner.get()) {
0 => true, 0 => false,
_ => false, _ => true,
} }
} }

Loading…
Cancel
Save