diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-10-06 08:55:51 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-10-06 08:55:51 +0200 |
commit | c2c9a582da8221eea5292620c74f96322899f0cb (patch) | |
tree | 0cc7f02772516b8c76f08436ee18224c0e0f9ede /core | |
parent | a47f9bd53aa66b6a4a3150e1910456aec463e3df (diff) | |
parent | 6bf02c016236c2d79b3e8cf10cfb580157535e5f (diff) |
Merge pull request #64815 from RandomShaper/default_cpu_count
Improve default `OS`'s CPU count getter
Diffstat (limited to 'core')
-rw-r--r-- | core/os/os.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/core/os/os.cpp b/core/os/os.cpp index 72d68893f3..bbb2a94fe7 100644 --- a/core/os/os.cpp +++ b/core/os/os.cpp @@ -38,6 +38,7 @@ #include "core/version_generated.gen.h" #include <stdarg.h> +#include <thread> OS *OS::singleton = nullptr; uint64_t OS::target_ticks = 0; @@ -321,7 +322,7 @@ String OS::get_unique_id() const { } int OS::get_processor_count() const { - return 1; + return std::thread::hardware_concurrency(); } String OS::get_processor_name() const { |