add RageThread::EnumThreadIDs

pass a ThreadId toForceCrashHandlerDeadlock; do away with crash handles
This commit is contained in:
Glenn Maynard
2004-09-07 02:58:59 +00:00
parent 3bf79d0bc4
commit 0ce4716c0e
2 changed files with 18 additions and 1 deletions
+17 -1
View File
@@ -269,6 +269,22 @@ const char *RageThread::GetThreadNameByID( uint64_t iID )
return slot->GetThreadName();
}
bool RageThread::EnumThreadIDs( int n, uint64_t &iID )
{
if( n >= MAX_THREADS )
return false;
LockMut(g_ThreadSlotsLock);
const ThreadSlot *slot = &g_ThreadSlots[n];
if( slot->used )
iID = slot->id;
else
iID = GetInvalidThreadId();
return true;
}
int RageThread::Wait()
{
ASSERT( m_pSlot != NULL );
@@ -558,7 +574,7 @@ void RageMutex::Lock()
#if defined(CRASH_HANDLER) && !defined(DARWIN)
/* Don't leave g_ThreadSlotsLock when we call ForceCrashHandlerDeadlock. */
g_ThreadSlotsLock.Lock();
uint64_t CrashHandle = OtherSlot && OtherSlot->pImpl? OtherSlot->pImpl->GetCrashHandle():0;
uint64_t CrashHandle = OtherSlot? OtherSlot->id:0;
g_ThreadSlotsLock.Unlock();
/* Pass the crash handle of the other thread, so it can backtrace that thread. */