From 2a64643fdc06531ff463377c9451633d72bb3723 Mon Sep 17 00:00:00 2001 From: "j4ck.fr0st" Date: Thu, 30 Sep 2010 17:17:13 +0000 Subject: [PATCH] Apply u-ra's patch to speed up CriticalSection on systems that use POSIX-threads (that is, not windows). git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6242 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Common/Src/Thread.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Source/Core/Common/Src/Thread.cpp b/Source/Core/Common/Src/Thread.cpp index af9b608c5e..e06c91170a 100644 --- a/Source/Core/Common/Src/Thread.cpp +++ b/Source/Core/Common/Src/Thread.cpp @@ -318,9 +318,13 @@ namespace Common void CriticalSection::Enter() { +#ifdef DEBUG int ret = pthread_mutex_lock(&mutex); if (ret) ERROR_LOG(COMMON, "%s: pthread_mutex_lock(%p) failed: %s\n", __FUNCTION__, &mutex, strerror(ret)); +#else + pthread_mutex_lock(&mutex); +#endif } @@ -332,9 +336,13 @@ namespace Common void CriticalSection::Leave() { +#ifdef DEBUG int ret = pthread_mutex_unlock(&mutex); if (ret) ERROR_LOG(COMMON, "%s: pthread_mutex_unlock(%p) failed: %s\n", __FUNCTION__, &mutex, strerror(ret)); +#else + pthread_mutex_unlock(&mutex); +#endif }