MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / check_worker_alive

Function check_worker_alive

src/core/impl/system.cpp:443–451  ·  view source on GitHub ↗

return whether worker is alive

Source from the content-addressed store, hash-verified

441
442 //! return whether worker is alive
443 bool check_worker_alive() {
444 if (m_worker_pid) {
445 auto wait_ret = waitpid(m_worker_pid, nullptr, WNOHANG);
446 CHECK_SYS_ERR(wait_ret);
447 if (!wait_ret)
448 return true;
449 }
450 return false;
451 }
452
453 //! start worker if it is not alive
454 void ensure_worker_alive() {

Callers 2

ensure_worker_aliveFunction · 0.85
invokeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected