From 976016b70103f991e686bc568dd915d041e89ca1 Mon Sep 17 00:00:00 2001 From: WinnerWind <71366717+WinnerWind@users.noreply.github.com> Date: Wed, 27 Aug 2025 09:02:34 +0530 Subject: [PATCH] Revert "Prevent crashing if `max_threads` is zero." This reverts commit a1788e09bf7b0fa419c238bb19c8f667833999bc. --- core/object/worker_thread_pool.cpp | 2 +- doc/classes/ProjectSettings.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/object/worker_thread_pool.cpp b/core/object/worker_thread_pool.cpp index df024fb6db2..e0a8d558c9a 100644 --- a/core/object/worker_thread_pool.cpp +++ b/core/object/worker_thread_pool.cpp @@ -780,7 +780,7 @@ void WorkerThreadPool::init(int p_thread_count, float p_low_priority_task_ratio) runlevel = RUNLEVEL_NORMAL; - if (p_thread_count <= 0) { + if (p_thread_count < 0) { p_thread_count = OS::get_singleton()->get_default_thread_pool_size(); } diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index 3ff61e184f9..e1f7cab588c 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -3404,7 +3404,7 @@ The ratio of [WorkerThreadPool]'s threads that will be reserved for low-priority tasks. For example, if 10 threads are available and this value is set to [code]0.3[/code], 3 of the worker threads will be reserved for low-priority tasks. The actual value won't exceed the number of CPU cores minus one, and if possible, at least one worker thread will be dedicated to low-priority tasks. - Maximum number of threads to be used by [WorkerThreadPool]. Value of [code]0[/code] or less means [code]1[/code] on Web, or a number of [i]logical[/i] CPU cores available on other platforms (see [method OS.get_processor_count]). + Maximum number of threads to be used by [WorkerThreadPool]. Value of [code]-1[/code] means [code]1[/code] on Web, or a number of [i]logical[/i] CPU cores available on other platforms (see [method OS.get_processor_count]). If [code]true[/code], enables the analog threshold binding modifier if supported by the XR runtime.