summaryrefslogtreecommitdiffstats
path: root/sys/kern/tty.c
diff options
context:
space:
mode:
authorart <art@openbsd.org>2007-03-15 10:22:29 +0000
committerart <art@openbsd.org>2007-03-15 10:22:29 +0000
commit29514732ed7d204db854b589692b0fd90dc452d0 (patch)
tree5e8143a1e45a8ca7a90bc7199927c179bed99d96 /sys/kern/tty.c
parentregen (diff)
downloadwireguard-openbsd-29514732ed7d204db854b589692b0fd90dc452d0.tar.xz
wireguard-openbsd-29514732ed7d204db854b589692b0fd90dc452d0.zip
Since p_flag is often manipulated in interrupts and without biglock
it's a good idea to use atomic.h operations on it. This mechanic change updates all bit operations on p_flag to atomic_{set,clear}bits_int. Only exception is that P_OWEUPC is set by MI code before calling need_proftick and it's automatically cleared by ADDUPC. There's no reason for MD handling of that flag since everyone handles it the same way. kettenis@ ok
Diffstat (limited to 'sys/kern/tty.c')
-rw-r--r--sys/kern/tty.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/tty.c b/sys/kern/tty.c
index c6c94bcbfff..5a8c65440c0 100644
--- a/sys/kern/tty.c
+++ b/sys/kern/tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty.c,v 1.71 2006/06/17 00:47:16 deraadt Exp $ */
+/* $OpenBSD: tty.c,v 1.72 2007/03/15 10:22:30 art Exp $ */
/* $NetBSD: tty.c,v 1.68.4.2 1996/06/06 16:04:52 thorpej Exp $ */
/*-
@@ -987,7 +987,7 @@ ttioctl(struct tty *tp, u_long cmd, caddr_t data, int flag, struct proc *p)
tp->t_session = p->p_session;
tp->t_pgrp = p->p_pgrp;
p->p_session->s_ttyp = tp;
- p->p_flag |= P_CONTROLT;
+ atomic_setbits_int(&p->p_flag, P_CONTROLT);
break;
case TIOCSPGRP: { /* set pgrp of tty */
struct pgrp *pgrp = pgfind(*(int *)data);