1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-10 13:00:37 +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.

(cherry picked from commit f3c6ac1d71)
This commit is contained in:
Fabio Alessandrelli
2020-09-23 11:24:01 +02:00
committed by Rémi Verschelde
parent bf9090c23f
commit 6dffc1ef46
3 changed files with 12 additions and 0 deletions

View File

@@ -1455,7 +1455,11 @@ Physics2DServerSW::Physics2DServerSW() {
island_count = 0;
active_objects = 0;
collision_pairs = 0;
#ifdef NO_THREADS
using_threads = false;
#else
using_threads = int(ProjectSettings::get_singleton()->get("physics/2d/thread_model")) == 2;
#endif
flushing_queries = false;
};