You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-09 12:50:35 +00:00
Ignore thread models when compiling with NO_THREAD
The thread model option for physics (2D) and rendering (single-unsafe, single-safe, multithread), was causing crashes/locks when set as multithreaded and exported for a platform that does not support threads (namely HTML5). This commit ensures that when threads support is not available, that option is ignored, and the equivalent of "single-unsafe" is always used instead.
This commit is contained in:
@@ -1274,9 +1274,13 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
|
||||
}
|
||||
|
||||
if (rtm >= 0 && rtm < 3) {
|
||||
#ifdef NO_THREADS
|
||||
rtm = OS::RENDER_THREAD_UNSAFE; // No threads available on this platform.
|
||||
#else
|
||||
if (editor) {
|
||||
rtm = OS::RENDER_THREAD_SAFE;
|
||||
}
|
||||
#endif
|
||||
OS::get_singleton()->_render_thread_mode = OS::RenderThreadMode(rtm);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user