| 245 | } |
| 246 | |
| 247 | void Emulator::BlockingCallFromMainThread(std::function<void()>&& func, std::source_location src_loc) const |
| 248 | { |
| 249 | atomic_t<u32> wake_up = 0; |
| 250 | |
| 251 | sys_log.trace("Blocking Callback from thread '%s' at [%s] is queued", thread_ctrl::get_name(), src_loc); |
| 252 | |
| 253 | CallFromMainThread(std::move(func), &wake_up, true, umax, src_loc); |
| 254 | |
| 255 | bool logged = false; |
| 256 | |
| 257 | while (!wake_up) |
| 258 | { |
| 259 | if (!logged && !thread_ctrl::get_current()) |
| 260 | { |
| 261 | logged = true; |
| 262 | sys_log.error("Calling thread of BlockingCallFromMainThread is not of named_thread<>, calling from %s", src_loc); |
| 263 | } |
| 264 | |
| 265 | wake_up.wait(0); |
| 266 | } |
| 267 | } |
| 268 | |
| 269 | // This function ensures constant initialization order between different compilers and builds |
| 270 | void init_fxo_for_exec(utils::serial* ar, bool full = false) |
no test coverage detected