summaryrefslogtreecommitdiff
path: root/Source/Core/Common
diff options
context:
space:
mode:
authorj4ck.fr0st <j4ck.fr0st@gmail.com>2010-09-30 17:17:13 +0000
committerj4ck.fr0st <j4ck.fr0st@gmail.com>2010-09-30 17:17:13 +0000
commit2a64643fdc06531ff463377c9451633d72bb3723 (patch)
treef5ab4c42cfd25e5944e063da44d539c3d1a5a59e /Source/Core/Common
parent1450385a53d3d1d0b641d24e6af3ecf8d2c23895 (diff)
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
Diffstat (limited to 'Source/Core/Common')
-rw-r--r--Source/Core/Common/Src/Thread.cpp8
1 files changed, 8 insertions, 0 deletions
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
}