mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-11 18:06:13 +00:00
lib/drmtest: Add igt_wait_helper
igt_wait_helper compliments igt_stop_helper and is used when helper processes are expected to exit naturally. Signed-off-by: Jeff McGee <jeff.mcgee@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
parent
3bada1626c
commit
fd3fcbd3b3
@ -1246,6 +1246,23 @@ void igt_stop_helper(struct igt_helper_process *proc)
|
|||||||
helper_process_count--;
|
helper_process_count--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void igt_wait_helper(struct igt_helper_process *proc)
|
||||||
|
{
|
||||||
|
int status;
|
||||||
|
|
||||||
|
assert(proc->running);
|
||||||
|
|
||||||
|
while (waitpid(proc->pid, &status, 0) == -1 &&
|
||||||
|
errno == EINTR)
|
||||||
|
;
|
||||||
|
igt_assert(WIFEXITED(status) && WEXITSTATUS(status) == 0);
|
||||||
|
|
||||||
|
proc->running = false;
|
||||||
|
|
||||||
|
helper_process_pids[proc->id] = -1;
|
||||||
|
helper_process_count--;
|
||||||
|
}
|
||||||
|
|
||||||
static void children_exit_handler(int sig)
|
static void children_exit_handler(int sig)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -290,6 +290,7 @@ struct igt_helper_process {
|
|||||||
};
|
};
|
||||||
bool __igt_fork_helper(struct igt_helper_process *proc);
|
bool __igt_fork_helper(struct igt_helper_process *proc);
|
||||||
void igt_stop_helper(struct igt_helper_process *proc);
|
void igt_stop_helper(struct igt_helper_process *proc);
|
||||||
|
void igt_wait_helper(struct igt_helper_process *proc);
|
||||||
#define igt_fork_helper(proc) \
|
#define igt_fork_helper(proc) \
|
||||||
for (; __igt_fork_helper(proc); exit(0))
|
for (; __igt_fork_helper(proc); exit(0))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user