| 3052 | } |
| 3053 | |
| 3054 | void |
| 3055 | thread_stopped(struct proc *p) |
| 3056 | { |
| 3057 | int n; |
| 3058 | |
| 3059 | PROC_LOCK_ASSERT(p, MA_OWNED); |
| 3060 | PROC_SLOCK_ASSERT(p, MA_OWNED); |
| 3061 | n = p->p_suspcount; |
| 3062 | if (p == curproc) |
| 3063 | n++; |
| 3064 | if ((p->p_flag & P_STOPPED_SIG) && (n == p->p_numthreads)) { |
| 3065 | PROC_SUNLOCK(p); |
| 3066 | p->p_flag &= ~P_WAITED; |
| 3067 | PROC_LOCK(p->p_pptr); |
| 3068 | childproc_stopped(p, (p->p_flag & P_TRACED) ? |
| 3069 | CLD_TRAPPED : CLD_STOPPED); |
| 3070 | PROC_UNLOCK(p->p_pptr); |
| 3071 | PROC_SLOCK(p); |
| 3072 | } |
| 3073 | } |
| 3074 | |
| 3075 | /* |
| 3076 | * Take the action for the specified signal |
no test coverage detected