1
0
Fork 0

Merge pull request #99416 from adamscott/set-thread-count-for-single-threaded

Force `get_thread_count()` to `1` if single threaded
This commit is contained in:
Thaddeus Crews 2024-11-22 14:54:28 -06:00
commit 514d73affc
1 changed files with 7 additions and 1 deletions

View File

@ -258,7 +258,13 @@ public:
bool is_group_task_completed(GroupID p_group) const;
void wait_for_group_task_completion(GroupID p_group);
_FORCE_INLINE_ int get_thread_count() const { return threads.size(); }
_FORCE_INLINE_ int get_thread_count() const {
#ifdef THREADS_ENABLED
return threads.size();
#else
return 1;
#endif
}
static WorkerThreadPool *get_singleton() { return singleton; }
static int get_thread_index();