Tier0: fix DEBUG compile error

Only occurred in DEBUG as Assert otherwise gets compiled out, and CThreadSpinRWLock::m_iWriteDepth only exists when compiled with REENTRANT_THREAD_SPIN_RW_LOCK. The game does not feature this so this is not defined. Moved to the REENTRANT_THREAD_SPIN_RW_LOCK block to only check on this assert when this feature is enabled.
This commit is contained in:
Kawe Mazidjatari 2024-03-31 15:18:43 +02:00
parent b290381804
commit b1b80d3be0

View File

@ -431,9 +431,10 @@ FORCEINLINE bool CThreadSpinRWLock::TryLockForWrite()
if (!(curValue.m_i32 & 0x00010000) && ThreadInterlockedAssignIf((LONG*)&curValue.m_i32, 0x00010000, 0))
{
ThreadMemoryBarrier();
Assert(m_iWriteDepth == 0 && m_writerId == 0);
Assert(m_writerId == 0);
m_writerId = ThreadGetCurrentId();
#ifdef REENTRANT_THREAD_SPIN_RW_LOCK
Assert(m_iWriteDepth == 0);
m_iWriteDepth++;
#endif
return true;