version 1.261, 2014/05/22 16:31:19 |
version 1.262, 2014/09/05 05:33:39 |
|
|
* Must be called with the tty lock held. |
* Must be called with the tty lock held. |
*/ |
*/ |
int |
int |
ttysleep(struct tty *tp, kcondvar_t *cv, bool catch, int timo) |
ttysleep(struct tty *tp, kcondvar_t *cv, bool catch_p, int timo) |
{ |
{ |
int error; |
int error; |
short gen; |
short gen; |
Line 2678 ttysleep(struct tty *tp, kcondvar_t *cv, |
|
Line 2678 ttysleep(struct tty *tp, kcondvar_t *cv, |
|
|
|
gen = tp->t_gen; |
gen = tp->t_gen; |
if (cv == NULL) |
if (cv == NULL) |
error = kpause("ttypause", catch, timo, &tty_lock); |
error = kpause("ttypause", catch_p, timo, &tty_lock); |
else if (catch) |
else if (catch_p) |
error = cv_timedwait_sig(cv, &tty_lock, timo); |
error = cv_timedwait_sig(cv, &tty_lock, timo); |
else |
else |
error = cv_timedwait(cv, &tty_lock, timo); |
error = cv_timedwait(cv, &tty_lock, timo); |
Line 2917 ttysigintr(void *cookie) |
|
Line 2917 ttysigintr(void *cookie) |
|
mutex_spin_enter(&tty_lock); |
mutex_spin_enter(&tty_lock); |
while ((tp = TAILQ_FIRST(&tty_sigqueue)) != NULL) { |
while ((tp = TAILQ_FIRST(&tty_sigqueue)) != NULL) { |
KASSERT(tp->t_sigcount > 0); |
KASSERT(tp->t_sigcount > 0); |
for (st = 0; st < TTYSIG_COUNT; st++) { |
for (st = TTYSIG_PG1; st < TTYSIG_COUNT; st++) { |
if ((sig = firstsig(&tp->t_sigs[st])) != 0) |
if ((sig = firstsig(&tp->t_sigs[st])) != 0) |
break; |
break; |
} |
} |