Lines Matching refs:self_lwp

841 rt_inline void _update_ru(struct rt_lwp *child, struct rt_lwp *self_lwp, struct rusage *uru)  in _update_ru()  argument
850 lwp_data_put(self_lwp, uru, &rt_rusage, sizeof(*uru)); in _update_ru()
856 struct rt_lwp *self_lwp, int *ustatus, in _stats_and_reap_child() argument
862 _update_ru(child, self_lwp, uru); in _stats_and_reap_child()
869 lwp_children_unregister(self_lwp, child); in _stats_and_reap_child()
873 lwp_data_put(self_lwp, ustatus, &lwp_stat, sizeof(*ustatus)); in _stats_and_reap_child()
881 static sysret_t _query_event_from_lwp(rt_lwp_t child, rt_thread_t cur_thr, rt_lwp_t self_lwp, in _query_event_from_lwp() argument
907 static pid_t _verify_child_and_reap(rt_thread_t cur_thr, rt_lwp_t self_lwp, in _verify_child_and_reap() argument
919 else if (child->parent != self_lwp) in _verify_child_and_reap()
928 rc = _query_event_from_lwp(child, cur_thr, self_lwp, options, ustatus); in _verify_child_and_reap()
931 _stats_and_reap_child(child, cur_thr, self_lwp, ustatus, options, uru); in _verify_child_and_reap()
938 static pid_t _reap_any_child_pid(rt_thread_t cur_thr, rt_lwp_t self_lwp, pid_t pair_pgid, in _reap_any_child_pid() argument
944 LWP_LOCK(self_lwp); in _reap_any_child_pid()
945 child = self_lwp->first_child; in _reap_any_child_pid()
953 rc = _query_event_from_lwp(child, cur_thr, self_lwp, options, ustatus); in _reap_any_child_pid()
959 LWP_UNLOCK(self_lwp); in _reap_any_child_pid()
963 _stats_and_reap_child(child, cur_thr, self_lwp, ustatus, options, uru); in _reap_any_child_pid()
968 rt_err_t lwp_waitpid_kick(rt_lwp_t parent, rt_lwp_t self_lwp) in lwp_waitpid_kick() argument
971 rt_wqueue_wakeup(&parent->waitpid_waiters, self_lwp); in lwp_waitpid_kick()
1046 static rt_err_t _wait_for_event(rt_thread_t cur_thr, rt_lwp_t self_lwp, in _wait_for_event() argument
1057 handle->wq_node.wqueue = &self_lwp->waitpid_waiters; in _wait_for_event()
1062 LOG_D("%s(self_lwp=%d) wait for event", __func__, self_lwp->pid); in _wait_for_event()
1098 static sysret_t _wait_and_reap(rt_thread_t cur_thr, rt_lwp_t self_lwp, const pid_t pid, in _wait_and_reap() argument
1108 rc = _wait_for_event(cur_thr, self_lwp, &handle, pid); in _wait_and_reap()
1117 _stats_and_reap_child(waker, cur_thr, self_lwp, ustatus, options, uru); in _wait_and_reap()
1132 struct rt_lwp *self_lwp; in lwp_waitpid() local
1135 self_lwp = lwp_self(); in lwp_waitpid()
1137 if (!cur_thr || !self_lwp) in lwp_waitpid()
1147 rc = _verify_child_and_reap(cur_thr, self_lwp, pid, options, status, ru); in lwp_waitpid()
1152 rc = _reap_any_child_pid(cur_thr, self_lwp, 0, options, status, ru); in lwp_waitpid()
1164 pair_pgid = lwp_pgid_get_byprocess(self_lwp); in lwp_waitpid()
1170 rc = _reap_any_child_pid(cur_thr, self_lwp, pair_pgid, options, status, ru); in lwp_waitpid()
1179 rc = _wait_and_reap(cur_thr, self_lwp, pid, options, status, ru); in lwp_waitpid()