You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-13 13:31:48 +00:00
Refactor CallQueue flushing for clarity
This commit is contained in:
@@ -222,11 +222,7 @@ void CallQueue::_call_function(const Callable &p_callable, const Variant *p_args
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Error CallQueue::flush() {
|
Error CallQueue::_transfer_messages_to_main_queue() {
|
||||||
LOCK_MUTEX;
|
|
||||||
|
|
||||||
// Thread overrides are not meant to be flushed, but appended to the main one.
|
|
||||||
if (this == MessageQueue::thread_singleton) {
|
|
||||||
if (pages.size() == 0) {
|
if (pages.size() == 0) {
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
@@ -276,8 +272,16 @@ Error CallQueue::flush() {
|
|||||||
pages_used = 1;
|
pages_used = 1;
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
Error CallQueue::flush() {
|
||||||
|
// Thread overrides are not meant to be flushed, but appended to the main one.
|
||||||
|
if (unlikely(this == MessageQueue::thread_singleton)) {
|
||||||
|
return _transfer_messages_to_main_queue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LOCK_MUTEX;
|
||||||
|
|
||||||
if (pages.size() == 0) {
|
if (pages.size() == 0) {
|
||||||
// Never allocated
|
// Never allocated
|
||||||
UNLOCK_MUTEX;
|
UNLOCK_MUTEX;
|
||||||
|
|||||||
@@ -98,6 +98,8 @@ private:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Error _transfer_messages_to_main_queue();
|
||||||
|
|
||||||
void _add_page();
|
void _add_page();
|
||||||
|
|
||||||
void _call_function(const Callable &p_callable, const Variant *p_args, int p_argcount, bool p_show_error);
|
void _call_function(const Callable &p_callable, const Variant *p_args, int p_argcount, bool p_show_error);
|
||||||
|
|||||||
Reference in New Issue
Block a user