2021-11-13 01:50:50 +08:00
|
|
|
#include "process_intr.h"
|
|
|
|
|
|
|
|
bool
|
|
|
|
sc_process_check_success_intr(struct sc_intr *intr, sc_pid pid,
|
2021-11-19 01:31:36 +08:00
|
|
|
const char *name, bool close) {
|
2021-11-13 01:50:50 +08:00
|
|
|
if (!sc_intr_set_process(intr, pid)) {
|
|
|
|
// Already interrupted
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Always pass close=false, interrupting would be racy otherwise
|
|
|
|
bool ret = sc_process_check_success(pid, name, false);
|
|
|
|
|
|
|
|
sc_intr_set_process(intr, SC_PROCESS_NONE);
|
2021-11-19 01:31:36 +08:00
|
|
|
|
|
|
|
if (close) {
|
|
|
|
// Close separately
|
|
|
|
sc_process_close(pid);
|
|
|
|
}
|
|
|
|
|
2021-11-13 01:50:50 +08:00
|
|
|
return ret;
|
|
|
|
}
|