Skip to content

Commit

Permalink
Fixed incorrect threads count on Linux (#339)
Browse files Browse the repository at this point in the history
  • Loading branch information
emoon authored Dec 29, 2022
1 parent cf4f794 commit c3416af
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
#include <sys/sysctl.h>
#endif

#if defined(TUNDRA_LINUX)
#include <thread>
#endif

#if defined(TUNDRA_WIN32)
#include <windows.h>
#include <ctype.h>
Expand Down Expand Up @@ -341,6 +345,8 @@ int GetCpuCount()
SYSTEM_INFO si;
GetSystemInfo(&si);
return (int) si.dwNumberOfProcessors;
#elif defined(TUNDRA_LINUX)
return (int)std::thread::hardware_concurrency();
#else
long nprocs_max = sysconf(_SC_NPROCESSORS_CONF);
if (nprocs_max < 0)
Expand Down

0 comments on commit c3416af

Please sign in to comment.