From 761006e18843fc8e3c6785850f18bfc1b934bb64 Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Tue, 2 Jun 2026 18:29:09 -0700 Subject: [PATCH] ppc: use std::mutex for host spinlocks Use the C++ standard mutex implementation for the non-Windows PPC spinlock wrapper instead of depending on GLib mutex types. This keeps the shared PPC coordinator free of an extra host runtime dependency when it is built outside Windows. --- ppc/ppc.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ppc/ppc.cpp b/ppc/ppc.cpp index b9b315c3..4ec0953b 100644 --- a/ppc/ppc.cpp +++ b/ppc/ppc.cpp @@ -47,8 +47,8 @@ static volatile bool ppc_spinlock_waiting; static CRITICAL_SECTION ppc_cs1, ppc_cs2; static bool ppc_cs_initialized; #else -#include -static GMutex mutex, mutex2; +#include +static std::mutex ppc_mutex, ppc_mutex2; #endif void uae_ppc_spinlock_get(void) @@ -60,11 +60,11 @@ void uae_ppc_spinlock_get(void) ppc_spinlock_waiting = false; LeaveCriticalSection(&ppc_cs2); #else - g_mutex_lock(&mutex2); + ppc_mutex2.lock(); ppc_spinlock_waiting = true; - g_mutex_lock(&mutex); + ppc_mutex.lock(); ppc_spinlock_waiting = false; - g_mutex_unlock(&mutex2); + ppc_mutex2.unlock(); #endif #if SPINLOCK_DEBUG if (spinlock_cnt != 0) @@ -83,7 +83,7 @@ void uae_ppc_spinlock_release(void) #ifdef WIN32_SPINLOCK LeaveCriticalSection(&ppc_cs1); #else - g_mutex_unlock(&mutex); + ppc_mutex.unlock(); #endif } -- 2.47.3