MCPcopy Create free account
hub / github.com/MrNeRF/LichtFeld-Studio / is_running

Method is_running

src/python/subprocess.cpp:76–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74 }
75
76 bool SubProcess::is_running() const {
77 if (pid_ <= 0)
78 return false;
79 int status;
80 const pid_t result = waitpid(pid_, &status, WNOHANG);
81 if (result == pid_) {
82 if (WIFEXITED(status))
83 const_cast<SubProcess*>(this)->exit_code_ = WEXITSTATUS(status);
84 else if (WIFSIGNALED(status))
85 const_cast<SubProcess*>(this)->exit_code_ = 128 + WTERMSIG(status);
86 const_cast<SubProcess*>(this)->pid_ = -1;
87 return false;
88 }
89 return result == 0;
90 }
91
92 void SubProcess::kill() {
93 if (stdout_fd_ >= 0) {

Callers 9

pollMethod · 0.45
install_asyncMethod · 0.45
uninstall_asyncMethod · 0.45
install_torch_asyncMethod · 0.45
install_async_rawMethod · 0.45
has_running_operationMethod · 0.45
TEST_FFunction · 0.45

Calls

no outgoing calls

Tested by 1

TEST_FFunction · 0.36