diff options
| author | Tim J. Robbins <tjr@FreeBSD.org> | 2003-02-10 06:06:46 +0000 |
|---|---|---|
| committer | Tim J. Robbins <tjr@FreeBSD.org> | 2003-02-10 06:06:46 +0000 |
| commit | fbf70de6b0f5dd17595bb38cad8d6b21234ba54b (patch) | |
| tree | 0d7bfcec6cd7e4f3a08545d1aeef8e902feff9a9 | |
| parent | a81f4c40b773124bf3c8a9bee5ec7e7e3080ab2c (diff) | |
Notes
| -rw-r--r-- | sys/kern/tty.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/sys/kern/tty.c b/sys/kern/tty.c index 4a223ffc5ec4..711fb65f362e 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -1842,21 +1842,32 @@ ttycheckoutq(struct tty *tp, int wait) { int hiwat, s; sigset_t oldmask; + struct proc *p = curproc; hiwat = tp->t_ohiwat; SIGEMPTYSET(oldmask); s = spltty(); - if (wait) - oldmask = curproc->p_siglist; + if (wait) { + PROC_LOCK(p); + oldmask = p->p_siglist; + PROC_UNLOCK(p); + } if (tp->t_outq.c_cc > hiwat + OBUFSIZ + 100) while (tp->t_outq.c_cc > hiwat) { ttstart(tp); if (tp->t_outq.c_cc <= hiwat) break; - if (!(wait && SIGSETEQ(curproc->p_siglist, oldmask))) { + if (!wait) { splx(s); return (0); } + PROC_LOCK(p); + if (!SIGSETEQ(p->p_siglist, oldmask)) { + PROC_UNLOCK(p); + splx(s); + return (0); + } + PROC_UNLOCK(p); SET(tp->t_state, TS_SO_OLOWAT); tsleep(TSA_OLOWAT(tp), PZERO - 1, "ttoutq", hz); } |
