Example Browser: add option (keypress 'p') to dump json timing profile trace, that you can open using Chrome about://tracing
Make btQuickprof thread safe Add option in btQuickprof to override custom timing profile (btSetCustomEnterProfileZoneFunc, btSetCustomLeaveProfileZoneFunc) remove b3Printf in a user/physics thread (those added added, while drawing the GUI running in the main thread)
This commit is contained in:
@@ -226,5 +226,23 @@ bool btSpinMutex::tryLock()
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // #else // #if BT_THREADSAFE
|
||||
unsigned int btGetCurrentThreadIndex()
|
||||
{
|
||||
const unsigned int kNullIndex = ~0U;
|
||||
#ifdef _WIN32
|
||||
__declspec( thread ) static unsigned int sThreadIndex = kNullIndex;
|
||||
|
||||
#else
|
||||
static __thread unsigned int sThreadIndex = kNullIndex;
|
||||
#endif
|
||||
static int gThreadCounter=0;
|
||||
|
||||
if ( sThreadIndex == kNullIndex )
|
||||
{
|
||||
sThreadIndex = gThreadCounter++;
|
||||
}
|
||||
return sThreadIndex;
|
||||
}
|
||||
|
||||
#endif // #if BT_THREADSAFE
|
||||
|
||||
|
||||
Reference in New Issue
Block a user