only use the mutex if using BT_THREADSAFE

This commit is contained in:
erwincoumans committed 2018-12-22 11:35:56 -08:00
1 parent 63ac2182ae
commit fb2baa81d6
1 file changed
+4
@@ -31,13 +31,17 @@ static btVector4 colors[4] =
static btVector4 selectColor2()
{
#ifdef BT_THREADSAFE
static btSpinMutex sMutex;
sMutex.lock();
#endif
static int curColor = 0;
btVector4 color = colors[curColor];
curColor++;
curColor &= 3;
#ifdef BT_THREADSAFE
sMutex.unlock();
#endif
return color;
}