summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/gdscript_cache.h
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gdscript/gdscript_cache.h')
-rw-r--r--modules/gdscript/gdscript_cache.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/modules/gdscript/gdscript_cache.h b/modules/gdscript/gdscript_cache.h
index c738233beb..4903da92b4 100644
--- a/modules/gdscript/gdscript_cache.h
+++ b/modules/gdscript/gdscript_cache.h
@@ -34,7 +34,7 @@
#include "gdscript.h"
#include "core/object/ref_counted.h"
-#include "core/os/mutex.h"
+#include "core/os/safe_binary_mutex.h"
#include "core/templates/hash_map.h"
#include "core/templates/hash_set.h"
@@ -48,7 +48,6 @@ public:
PARSED,
INHERITANCE_SOLVED,
INTERFACE_SOLVED,
- BODY_SOLVED,
FULLY_SOLVED,
};
@@ -60,12 +59,14 @@ private:
String path;
uint32_t source_hash = 0;
bool clearing = false;
+ bool abandoned = false;
friend class GDScriptCache;
friend class GDScript;
public:
Status get_status() const;
+ String get_path() const;
uint32_t get_source_hash() const;
GDScriptParser *get_parser();
GDScriptAnalyzer *get_analyzer();
@@ -79,10 +80,12 @@ public:
class GDScriptCache {
// String key is full path.
HashMap<String, GDScriptParserRef *> parser_map;
+ HashMap<String, Vector<ObjectID>> abandoned_parser_map;
HashMap<String, Ref<GDScript>> shallow_gdscript_cache;
HashMap<String, Ref<GDScript>> full_gdscript_cache;
HashMap<String, Ref<GDScript>> static_gdscript_cache;
HashMap<String, HashSet<String>> dependencies;
+ HashMap<String, HashSet<String>> parser_inverse_dependencies;
friend class GDScript;
friend class GDScriptParserRef;
@@ -92,7 +95,12 @@ class GDScriptCache {
bool cleared = false;
- Mutex mutex;
+public:
+ static const int BINARY_MUTEX_TAG = 2;
+
+private:
+ static SafeBinaryMutex<BINARY_MUTEX_TAG> mutex;
+ friend SafeBinaryMutex<BINARY_MUTEX_TAG> &_get_gdscript_cache_mutex();
public:
static void move_script(const String &p_from, const String &p_to);