You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-20 14:45:44 +00:00
Let calls through thread guards in resource loading contexts
This commit is contained in:
@@ -522,8 +522,8 @@ public:
|
|||||||
_FORCE_INLINE_ bool is_accessible_from_caller_thread() const {
|
_FORCE_INLINE_ bool is_accessible_from_caller_thread() const {
|
||||||
if (current_process_thread_group == nullptr) {
|
if (current_process_thread_group == nullptr) {
|
||||||
// Not thread processing. Only accessible if node is outside the scene tree,
|
// Not thread processing. Only accessible if node is outside the scene tree,
|
||||||
// or if accessing from the main thread.
|
// if accessing from the main thread or being loaded.
|
||||||
return !data.inside_tree || Thread::is_main_thread();
|
return !data.inside_tree || Thread::is_main_thread() || ResourceLoader::is_within_load();
|
||||||
} else {
|
} else {
|
||||||
// Thread processing
|
// Thread processing
|
||||||
return current_process_thread_group == data.process_thread_group_owner;
|
return current_process_thread_group == data.process_thread_group_owner;
|
||||||
@@ -532,7 +532,7 @@ public:
|
|||||||
|
|
||||||
_FORCE_INLINE_ bool is_readable_from_caller_thread() const {
|
_FORCE_INLINE_ bool is_readable_from_caller_thread() const {
|
||||||
if (current_process_thread_group == nullptr) {
|
if (current_process_thread_group == nullptr) {
|
||||||
return Thread::is_main_thread();
|
return Thread::is_main_thread() || ResourceLoader::is_within_load();
|
||||||
} else {
|
} else {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user