summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-06-01 15:52:16 +0200
committerRémi Verschelde <rverschelde@gmail.com>2023-06-01 15:52:16 +0200
commit2e273f0e35800f2bcc7c05db54100caa97928f69 (patch)
treea77cc92b4f5c87dfa0a4bc3616e5d5d25cdfbaa4
parent42775ff75b8611e64ae76268221e6ad2806ea005 (diff)
parent8c288918a0b02606e13be0e75dd9dd278764d2f4 (diff)
downloadredot-engine-2e273f0e35800f2bcc7c05db54100caa97928f69.tar.gz
Merge pull request #77724 from RandomShaper/remove_red_th_cond
Remove redundant check from thread guards
-rw-r--r--scene/main/node.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/scene/main/node.h b/scene/main/node.h
index 35748d63b7..e848ab112a 100644
--- a/scene/main/node.h
+++ b/scene/main/node.h
@@ -541,19 +541,22 @@ public:
}
_FORCE_INLINE_ bool is_accessible_from_caller_thread() const {
if (current_process_thread_group == nullptr) {
- // Not thread processing. Only accessible if node is outside the scene tree,
- // if accessing from the main thread or being loaded.
+ // No thread processing.
+ // Only accessible if node is outside the scene tree
+ // or access will happen from a node-safe thread.
return !data.inside_tree || is_current_thread_safe_for_nodes();
} else {
- // Thread processing
+ // Thread processing.
return current_process_thread_group == data.process_thread_group_owner;
}
}
_FORCE_INLINE_ bool is_readable_from_caller_thread() const {
if (current_process_thread_group == nullptr) {
- return Thread::is_main_thread() || is_current_thread_safe_for_nodes();
+ // No thread processing.
+ return is_current_thread_safe_for_nodes();
} else {
+ // Thread processing.
return true;
}
}