From f8aca7b2b1196b412692d5d2ffa59efb83af973c Mon Sep 17 00:00:00 2001 From: Fenrir Date: Wed, 24 Jan 2018 00:25:47 -0700 Subject: [PATCH] Fix mutex try_lock logic Wow, not sure how I messed that one up --- ctr-std/src/sys/unix/mutex.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ctr-std/src/sys/unix/mutex.rs b/ctr-std/src/sys/unix/mutex.rs index 51e6b47..95c74a4 100644 --- a/ctr-std/src/sys/unix/mutex.rs +++ b/ctr-std/src/sys/unix/mutex.rs @@ -46,8 +46,8 @@ impl Mutex { #[inline] pub unsafe fn try_lock(&self) -> bool { match ::libctru::LightLock_TryLock(self.inner.get()) { - 0 => true, - _ => false, + 0 => false, + _ => true, } } @@ -77,8 +77,8 @@ impl ReentrantMutex { #[inline] pub unsafe fn try_lock(&self) -> bool { match ::libctru::RecursiveLock_TryLock(self.inner.get()) { - 0 => true, - _ => false, + 0 => false, + _ => true, } }