minor optimization

This commit is contained in:
Glenn Maynard
2005-08-24 02:26:36 +00:00
parent 8a64df1865
commit da269be1a2
+3 -2
View File
@@ -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. */