This commit is contained in:
erwincoumans
2019-06-01 07:29:09 -07:00
39 changed files with 135069 additions and 9159 deletions

View File

@@ -45,14 +45,14 @@ subject to the following restrictions:
int btGetNumHardwareThreads()
{
return btMin<int>(BT_MAX_THREAD_COUNT, std::thread::hardware_concurrency());
return btMax(1u, btMin(BT_MAX_THREAD_COUNT, std::thread::hardware_concurrency()));
}
#else
int btGetNumHardwareThreads()
{
return btMin<int>(BT_MAX_THREAD_COUNT, sysconf(_SC_NPROCESSORS_ONLN));
return btMax(1, btMin<int>(BT_MAX_THREAD_COUNT, sysconf(_SC_NPROCESSORS_ONLN)));
}
#endif