Simplify.
This commit is contained in:
@@ -164,15 +164,12 @@ static void InitThreads()
|
|||||||
if( bInitialized )
|
if( bInitialized )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
GetThreadSlotsLock().Lock();
|
LockMut( GetThreadSlotsLock() );
|
||||||
|
|
||||||
/* Libraries might start threads on their own, which might call user callbacks,
|
/* Libraries might start threads on their own, which might call user callbacks,
|
||||||
* which could come back here. Make sure we don't accidentally initialize twice. */
|
* which could come back here. Make sure we don't accidentally initialize twice. */
|
||||||
if( bInitialized )
|
if( bInitialized )
|
||||||
{
|
|
||||||
GetThreadSlotsLock().Unlock();
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
bInitialized = true;
|
bInitialized = true;
|
||||||
|
|
||||||
@@ -182,8 +179,6 @@ static void InitThreads()
|
|||||||
g_ThreadSlots[slot].m_iID = GetInvalidThreadId();
|
g_ThreadSlots[slot].m_iID = GetInvalidThreadId();
|
||||||
sprintf( g_ThreadSlots[slot].m_szThreadFormattedOutput, "Unknown thread" );
|
sprintf( g_ThreadSlots[slot].m_szThreadFormattedOutput, "Unknown thread" );
|
||||||
g_pUnknownThreadSlot = &g_ThreadSlots[slot];
|
g_pUnknownThreadSlot = &g_ThreadSlots[slot];
|
||||||
|
|
||||||
GetThreadSlotsLock().Unlock();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user