Make languages bookkeeping thread-safe

This commit is contained in:
Pedro J. Estébanez
2023-11-09 12:29:47 +01:00
parent 3e7f638d7b
commit f3e96a8548
4 changed files with 41 additions and 10 deletions

View File

@@ -52,9 +52,11 @@ class ScriptServer {
static ScriptLanguage *_languages[MAX_LANGUAGES];
static int _language_count;
static bool languages_ready;
static Mutex languages_mutex;
static bool scripting_enabled;
static bool reload_scripts_on_save;
static SafeFlag languages_finished; // Used until GH-76581 is fixed properly.
struct GlobalScriptClass {
StringName language;
@@ -98,8 +100,7 @@ public:
static void init_languages();
static void finish_languages();
static bool are_languages_finished() { return languages_finished.is_set(); }
static bool are_languages_initialized();
};
class PlaceHolderScriptInstance;