mirror of
https://github.com/bulletphysics/bullet3.git
synced 2026-11-17 21:26:06 +00:00
iOS platform and Android don't have __thread local storage, so avoid multi-threaded profiler on those (only on _WIN32, __linux__ and __APPLE__ and not TARGET_OS_IPHONE
Add a Sleep(0) for Windows to yield threads (and not Sleep(1))
This commit is contained in:
@@ -226,23 +226,6 @@ bool btSpinMutex::tryLock()
|
||||
return true;
|
||||
}
|
||||
|
||||
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