Merge pull request #110003 from WinnerWind/fix-zero-threadcount

Revert "Prevent crashing if `max_threads` is zero."
This commit is contained in:
Thaddeus Crews 2025-08-27 13:39:44 -05:00
commit 221731f30e
No known key found for this signature in database
GPG key ID: 8C6E5FEB5FC03CCC
2 changed files with 2 additions and 2 deletions

View file

@ -823,7 +823,7 @@ void WorkerThreadPool::init(int p_thread_count, float p_low_priority_task_ratio)
runlevel = RUNLEVEL_NORMAL; runlevel = RUNLEVEL_NORMAL;
if (p_thread_count <= 0) { if (p_thread_count < 0) {
p_thread_count = OS::get_singleton()->get_default_thread_pool_size(); p_thread_count = OS::get_singleton()->get_default_thread_pool_size();
} }

View file

@ -3405,7 +3405,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. 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.
</member> </member>
<member name="threading/worker_pool/max_threads" type="int" setter="" getter="" default="-1"> <member name="threading/worker_pool/max_threads" type="int" setter="" getter="" default="-1">
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]).
</member> </member>
<member name="xr/openxr/binding_modifiers/analog_threshold" type="bool" setter="" getter="" default="false"> <member name="xr/openxr/binding_modifiers/analog_threshold" type="bool" setter="" getter="" default="false">
If [code]true[/code], enables the analog threshold binding modifier if supported by the XR runtime. If [code]true[/code], enables the analog threshold binding modifier if supported by the XR runtime.