mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Add THREADS_ENABLED macro in order to compile Godot to run on the main thread
This commit is contained in:
parent
107f2961cc
commit
bd70b8e1f6
33 changed files with 447 additions and 72 deletions
|
@ -1615,12 +1615,18 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
|
|||
}
|
||||
|
||||
// Initialize WorkerThreadPool.
|
||||
if (editor || project_manager) {
|
||||
WorkerThreadPool::get_singleton()->init(-1, 0.75);
|
||||
} else {
|
||||
int worker_threads = GLOBAL_GET("threading/worker_pool/max_threads");
|
||||
float low_priority_ratio = GLOBAL_GET("threading/worker_pool/low_priority_thread_ratio");
|
||||
WorkerThreadPool::get_singleton()->init(worker_threads, low_priority_ratio);
|
||||
{
|
||||
#ifdef THREADS_ENABLED
|
||||
if (editor || project_manager) {
|
||||
WorkerThreadPool::get_singleton()->init(-1, 0.75);
|
||||
} else {
|
||||
int worker_threads = GLOBAL_GET("threading/worker_pool/max_threads");
|
||||
float low_priority_ratio = GLOBAL_GET("threading/worker_pool/low_priority_thread_ratio");
|
||||
WorkerThreadPool::get_singleton()->init(worker_threads, low_priority_ratio);
|
||||
}
|
||||
#else
|
||||
WorkerThreadPool::get_singleton()->init(0, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef TOOLS_ENABLED
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue