MCPcopy Create free account
hub / github.com/RPCSX/rpcsx / CallFromMainThread

Method CallFromMainThread

rpcs3/Emu/System.cpp:230–245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

228}
229
230void Emulator::CallFromMainThread(std::function<void()>&& func, atomic_t<u32>* wake_up, bool track_emu_state, u64 stop_ctr, std::source_location src_loc) const
231{
232 std::function<void()> final_func = [this, before = IsStopped(), track_emu_state, thread_name = thread_ctrl::get_name(), src = src_loc, count = (stop_ctr == umax ? +m_stop_ctr : stop_ctr), func = std::move(func)]
233 {
234 const bool call_it = (!track_emu_state || (count == m_stop_ctr && before == IsStopped()));
235
236 sys_log.trace("Callback from thread '%s' at [%s] is %s", thread_name, src, call_it ? "called" : "skipped");
237
238 if (call_it)
239 {
240 func();
241 }
242 };
243
244 m_cb.call_from_main_thread(std::move(final_func), wake_up);
245}
246
247void Emulator::BlockingCallFromMainThread(std::function<void()>&& func, std::source_location src_loc) const
248{

Callers 15

open_msg_dialogFunction · 0.45
cellAudioOutConfigureFunction · 0.45
cmd_killMethod · 0.45
operator()Method · 0.45
on_taskMethod · 0.45
CloseMethod · 0.45
createMethod · 0.45
update_msgMethod · 0.45
inc_valueMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected