minor optimization
This commit is contained in:
@@ -550,7 +550,8 @@ RageMutex::~RageMutex()
|
|||||||
|
|
||||||
void RageMutex::Lock()
|
void RageMutex::Lock()
|
||||||
{
|
{
|
||||||
if( m_LockedBy == (uint64_t) GetThisThreadId() )
|
uint64_t iThisThreadId = (uint64_t) GetThisThreadId();
|
||||||
|
if( m_LockedBy == iThisThreadId )
|
||||||
{
|
{
|
||||||
++m_LockCnt;
|
++m_LockCnt;
|
||||||
return;
|
return;
|
||||||
@@ -583,7 +584,7 @@ void RageMutex::Lock()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
m_LockedBy = GetThisThreadId();
|
m_LockedBy = iThisThreadId;
|
||||||
|
|
||||||
/* This has internal thread safety issues itself (eg. one thread may delete
|
/* This has internal thread safety issues itself (eg. one thread may delete
|
||||||
* a mutex while another locks one); disable for now. */
|
* a mutex while another locks one); disable for now. */
|
||||||
|
|||||||
Reference in New Issue
Block a user