summaryrefslogtreecommitdiff
path: root/platform/javascript/js
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-05-11 01:04:48 +0200
committerGitHub <noreply@github.com>2022-05-11 01:04:48 +0200
commit1eebf0d789f44870a32a1b36a6609a19647a836f (patch)
tree726c882598fafc8cd85c63198455eddbeda8e9ae /platform/javascript/js
parent694baff233c2efb4675f708389c9ff2bbc00bc03 (diff)
parentd2bb5b88cc6215f8312f24bec29f8ddc0d75d9a5 (diff)
Merge pull request #60937 from Faless/js/4.x_webgl2_include
Diffstat (limited to 'platform/javascript/js')
-rw-r--r--platform/javascript/js/libs/library_godot_os.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/platform/javascript/js/libs/library_godot_os.js b/platform/javascript/js/libs/library_godot_os.js
index 12d06a8d51..377eec3234 100644
--- a/platform/javascript/js/libs/library_godot_os.js
+++ b/platform/javascript/js/libs/library_godot_os.js
@@ -305,7 +305,9 @@ const GodotOS = {
godot_js_os_hw_concurrency_get__sig: 'i',
godot_js_os_hw_concurrency_get: function () {
- return navigator.hardwareConcurrency || 1;
+ // TODO Godot core needs fixing to avoid spawning too many threads (> 24).
+ const concurrency = navigator.hardwareConcurrency || 1;
+ return concurrency < 2 ? concurrency : 2;
},
godot_js_os_download_buffer__sig: 'viiii',