Merge pull request #78845 from RandomShaper/fix_wtp_zero_batch_lazy
Fix zero-sized WorkerThreadPool not processing group tasks
This commit is contained in:
commit
862a2841c0
|
@ -416,7 +416,7 @@ Error WorkerThreadPool::wait_for_task_completion(TaskID p_task_id) {
|
||||||
WorkerThreadPool::GroupID WorkerThreadPool::_add_group_task(const Callable &p_callable, void (*p_func)(void *, uint32_t), void *p_userdata, BaseTemplateUserdata *p_template_userdata, int p_elements, int p_tasks, bool p_high_priority, const String &p_description) {
|
WorkerThreadPool::GroupID WorkerThreadPool::_add_group_task(const Callable &p_callable, void (*p_func)(void *, uint32_t), void *p_userdata, BaseTemplateUserdata *p_template_userdata, int p_elements, int p_tasks, bool p_high_priority, const String &p_description) {
|
||||||
ERR_FAIL_COND_V(p_elements < 0, INVALID_TASK_ID);
|
ERR_FAIL_COND_V(p_elements < 0, INVALID_TASK_ID);
|
||||||
if (p_tasks < 0) {
|
if (p_tasks < 0) {
|
||||||
p_tasks = threads.size();
|
p_tasks = MAX(1u, threads.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
task_mutex.lock();
|
task_mutex.lock();
|
||||||
|
|
Loading…
Reference in New Issue