MCPcopy Create free account
hub / github.com/GDRETools/gdsdecomp / _dispatch_to_main_thread

Method _dispatch_to_main_thread

utility/task_manager.cpp:396–406  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

394 }
395}
396bool TaskManager::_dispatch_to_main_thread(std::shared_ptr<BaseMainThreadDispatchData> p_data) {
397 if (Thread::is_main_thread()) {
398 p_data->callback();
399 return p_data->is_canceled();
400 }
401 while (!main_thread_dispatch_queue.try_push(p_data)) {
402 OS::get_singleton()->delay_usec(10000); // wait for a slot to become available
403 }
404 p_data->wait_for_completion();
405 return p_data->is_canceled();
406}
407
408void TaskManager::process_main_thread_dispatch_queue_for(int64_t time_usec) {
409 if (!Thread::is_main_thread()) {

Callers

nothing calls this directly

Calls 4

callbackMethod · 0.80
is_canceledMethod · 0.45
try_pushMethod · 0.45
wait_for_completionMethod · 0.45

Tested by

no test coverage detected