From da269be1a25d0455dc4bc2d86c0ca5bc2e0aea57 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Wed, 24 Aug 2005 02:26:36 +0000 Subject: [PATCH] minor optimization --- stepmania/src/RageThreads.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/stepmania/src/RageThreads.cpp b/stepmania/src/RageThreads.cpp index 3936ff80e7..f05eac9417 100644 --- a/stepmania/src/RageThreads.cpp +++ b/stepmania/src/RageThreads.cpp @@ -550,7 +550,8 @@ RageMutex::~RageMutex() void RageMutex::Lock() { - if( m_LockedBy == (uint64_t) GetThisThreadId() ) + uint64_t iThisThreadId = (uint64_t) GetThisThreadId(); + if( m_LockedBy == iThisThreadId ) { ++m_LockCnt; return; @@ -583,7 +584,7 @@ void RageMutex::Lock() #endif } - m_LockedBy = GetThisThreadId(); + m_LockedBy = iThisThreadId; /* This has internal thread safety issues itself (eg. one thread may delete * a mutex while another locks one); disable for now. */