forked from lix-project/hydra
feat(hydra-eval-jobs.cc): add check_pid_status_nonblocking to catch handler
This commit is contained in:
parent
cb4fa0000f
commit
62cdbc4138
|
@ -25,7 +25,7 @@
|
||||||
|
|
||||||
#include <nlohmann/json.hpp>
|
#include <nlohmann/json.hpp>
|
||||||
|
|
||||||
void check_pid_status_quick(pid_t check_pid) {
|
void check_pid_status_nonblocking(pid_t check_pid) {
|
||||||
// Only check 'initialized' and known PID's
|
// Only check 'initialized' and known PID's
|
||||||
if (check_pid <= 0) { return; }
|
if (check_pid <= 0) { return; }
|
||||||
|
|
||||||
|
@ -333,8 +333,8 @@ int main(int argc, char * * argv)
|
||||||
/* Start a handler thread per worker process. */
|
/* Start a handler thread per worker process. */
|
||||||
auto handler = [&]()
|
auto handler = [&]()
|
||||||
{
|
{
|
||||||
try {
|
|
||||||
pid_t pid = -1;
|
pid_t pid = -1;
|
||||||
|
try {
|
||||||
AutoCloseFD from, to;
|
AutoCloseFD from, to;
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
|
@ -436,6 +436,7 @@ int main(int argc, char * * argv)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
|
check_pid_status_nonblocking(pid);
|
||||||
auto state(state_.lock());
|
auto state(state_.lock());
|
||||||
state->exc = std::current_exception();
|
state->exc = std::current_exception();
|
||||||
wakeup.notify_all();
|
wakeup.notify_all();
|
||||||
|
|
Loading…
Reference in a new issue