Merge pull request #54499 from Faless/threads/4.x_work_pool_default
This commit is contained in:
commit
fc9de5ba7f
|
@ -298,6 +298,7 @@ public:
|
|||
virtual void set_exit_code(int p_code);
|
||||
|
||||
virtual int get_processor_count() const;
|
||||
virtual int get_default_thread_pool_size() const { return get_processor_count(); }
|
||||
|
||||
virtual String get_unique_id() const;
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ void ThreadWorkPool::_thread_function(void *p_user) {
|
|||
void ThreadWorkPool::init(int p_thread_count) {
|
||||
ERR_FAIL_COND(threads != nullptr);
|
||||
if (p_thread_count < 0) {
|
||||
p_thread_count = OS::get_singleton()->get_processor_count();
|
||||
p_thread_count = OS::get_singleton()->get_default_thread_pool_size();
|
||||
}
|
||||
|
||||
thread_count = p_thread_count;
|
||||
|
|
|
@ -75,6 +75,7 @@ public:
|
|||
Error kill(const ProcessID &p_pid) override;
|
||||
int get_process_id() const override;
|
||||
int get_processor_count() const override;
|
||||
int get_default_thread_pool_size() const override { return 1; }
|
||||
|
||||
String get_executable_path() const override;
|
||||
Error shell_open(String p_uri) override;
|
||||
|
|
Loading…
Reference in New Issue