MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / callback

Method callback

core/os/thread.cpp:60–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58
59#ifdef THREADS_ENABLED
60void Thread::callback(ID p_caller_id, const Settings &p_settings, Callback p_callback, void *p_userdata) {
61 Thread::caller_id = p_caller_id;
62 if (platform_functions.set_priority) {
63 platform_functions.set_priority(p_settings.priority);
64 }
65 if (platform_functions.init) {
66 platform_functions.init();
67 }
68 ScriptServer::thread_enter(); // Scripts may need to attach a stack.
69 if (platform_functions.wrapper) {
70 platform_functions.wrapper(p_callback, p_userdata);
71 } else {
72 p_callback(p_userdata);
73 }
74 ScriptServer::thread_exit();
75 if (platform_functions.term) {
76 platform_functions.term();
77 }
78}
79
80Thread::ID Thread::start(Thread::Callback p_callback, void *p_user, const Settings &p_settings) {
81 ERR_FAIL_COND_V_MSG(id != UNASSIGNED_ID, UNASSIGNED_ID, "A Thread object has been re-started without wait_to_finish() having been called on it.");

Callers 6

_cullMethod · 0.45
thread_callbackMethod · 0.45
_mix_stepMethod · 0.45
updateMethod · 0.45
_run_render_commandsMethod · 0.45

Calls 2

set_priorityMethod · 0.45
initMethod · 0.45

Tested by

no test coverage detected