- /* if SIGTTOU or SIGTTIN then block till SIGCONT */
- if ((pri & PTTYBLOCK) && ((sig == SIGTTOU) || (sig == SIGTTIN))) {
- p->p_flag |= P_TTYSLEEP;
- /* reset signal bits */
- clear_procsiglist(p, sig);
- assert_wait(&p->p_siglist, THREAD_ABORTSAFE);
- /* assert wait can block and SIGCONT should be checked */
- if (p->p_flag & P_TTYSLEEP) {
- thread_block(THREAD_CONTINUE_NULL);
-
- if (mtx && !dropmutex)
- lck_mtx_lock(mtx);
- }
-
- /* return with success */
- error = 0;
- goto out;
- }