From 41196abe11d66c733459654228c9b74c978a1a2e Mon Sep 17 00:00:00 2001 From: Sergi Granell Date: Sat, 9 Sep 2023 13:55:38 +0200 Subject: [PATCH] mutex: fix svcArbitrateLock call arguments 1st (thread handle) and 3rd (tag) arguments were swapped. --- nx/source/kernel/mutex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nx/source/kernel/mutex.c b/nx/source/kernel/mutex.c index 86ae2628..13f9cf58 100644 --- a/nx/source/kernel/mutex.c +++ b/nx/source/kernel/mutex.c @@ -55,7 +55,7 @@ void mutexLock(Mutex* m) { } // Ask the kernel to arbitrate the lock for us. - if (UNLIKELY(R_FAILED(svcArbitrateLock(value & ~HANDLE_WAIT_MASK, m, cur_handle)))) { + if (UNLIKELY(R_FAILED(svcArbitrateLock(cur_handle, m, value & ~HANDLE_WAIT_MASK)))) { // This should be impossible under normal circumstances. svcBreak(BreakReason_Assert, 0, 0); }