Lines Matching refs:wait
6 #include "child-wait.h"
8 #include <sys/wait.h>
19 /* pid_t => wait */
27 struct child_wait *wait;
29 wait = i_new(struct child_wait, 1);
30 wait->callback = callback;
31 wait->context = context;
34 child_wait_add_pid(wait, pid);
35 return wait;
40 struct child_wait *wait = *_wait;
47 if (wait->pid_count > 0) {
51 if (value == wait) {
53 if (--wait->pid_count == 0)
60 i_free(wait);
63 void child_wait_add_pid(struct child_wait *wait, pid_t pid)
65 wait->pid_count++;
66 hash_table_insert(child_pids, POINTER_CAST(pid), wait);
69 void child_wait_remove_pid(struct child_wait *wait, pid_t pid)
71 wait->pid_count--;
81 status.wait = hash_table_lookup(child_pids,
83 if (status.wait != NULL) {
84 child_wait_remove_pid(status.wait, status.pid);
85 status.wait->callback(&status, status.wait->context);