* Restores the STOP handling mode, typically permitting the delivery * of SIGSTOP for the current thread. This does not immediately * suspend if a stop was posted. Instead, the thread will suspend * either via ast() or a subsequent interruptible sleep. */
| 2813 | * either via ast() or a subsequent interruptible sleep. |
| 2814 | */ |
| 2815 | void |
| 2816 | sigallowstop_impl(int prev) |
| 2817 | { |
| 2818 | struct thread *td; |
| 2819 | int cflags; |
| 2820 | |
| 2821 | KASSERT(prev != SIGDEFERSTOP_VAL_NCHG, ("failed sigallowstop")); |
| 2822 | KASSERT((prev & ~(TDF_SBDRY | TDF_SEINTR | TDF_SERESTART)) == 0, |
| 2823 | ("sigallowstop: incorrect previous mode %x", prev)); |
| 2824 | td = curthread; |
| 2825 | cflags = sigdeferstop_curr_flags(td->td_flags); |
| 2826 | if (cflags != prev) { |
| 2827 | thread_lock(td); |
| 2828 | td->td_flags = (td->td_flags & ~cflags) | prev; |
| 2829 | thread_unlock(td); |
| 2830 | } |
| 2831 | } |
| 2832 | |
| 2833 | /* |
| 2834 | * If the current process has received a signal (should be caught or cause |
no test coverage detected