fix compile errors in non-threadsafe build

This commit is contained in:
Lunkhound
2017-05-23 02:34:29 -07:00
parent dfe184e8d3
commit d77c3d5b68
3 changed files with 22 additions and 1 deletions

View File

@@ -114,7 +114,10 @@ struct InplaceSolverIslandCallbackMt : public btSimulationIslandManagerMt::Islan
btConstraintSolverPoolMt::ThreadSolver* btConstraintSolverPoolMt::getAndLockThreadSolver()
{
int i = btGetCurrentThreadIndex() % m_solvers.size();
int i = 0;
#if BT_THREADSAFE
i = btGetCurrentThreadIndex() % m_solvers.size();
#endif // #if BT_THREADSAFE
while ( true )
{
ThreadSolver& solver = m_solvers[ i ];

View File

@@ -465,6 +465,12 @@ bool btSpinMutex::tryLock()
return true;
}
// non-parallel version of btParallelFor
void btParallelFor( int iBegin, int iEnd, int grainSize, const btIParallelForBody& body )
{
btAssert(!"called btParallelFor in non-threadsafe build. enable BT_THREADSAFE");
body.forLoop( iBegin, iEnd );
}
#endif // #if BT_THREADSAFE