summaryrefslogtreecommitdiff
path: root/sys/kern/kern_clock.c
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2007-03-15 10:22:31 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2007-03-15 10:22:31 +0000
commitbd2b614cddbdb963198fdd15728e067d209f3cf7 (patch)
tree1710a23e5d69760e81f4955e44aac6e49a944b07 /sys/kern/kern_clock.c
parentb93b6840228d38589b6e976f3a325539c4fc9ae0 (diff)
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/kern_clock.c')
-rw-r--r--sys/kern/kern_clock.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c
index 024bc6cc2ae..ba55361a277 100644
--- a/sys/kern/kern_clock.c
+++ b/sys/kern/kern_clock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_clock.c,v 1.60 2006/12/24 20:29:45 miod Exp $ */
+/* $OpenBSD: kern_clock.c,v 1.61 2007/03/15 10:22:30 art Exp $ */
/* $NetBSD: kern_clock.c,v 1.34 1996/06/09 04:51:03 briggs Exp $ */
/*-
@@ -446,7 +446,7 @@ startprofclock(struct proc *p)
int s;
if ((p->p_flag & P_PROFIL) == 0) {
- p->p_flag |= P_PROFIL;
+ atomic_setbits_int(&p->p_flag, P_PROFIL);
if (++profprocs == 1 && stathz != 0) {
s = splstatclock();
psdiv = pscnt = psratio;
@@ -465,7 +465,7 @@ stopprofclock(struct proc *p)
int s;
if (p->p_flag & P_PROFIL) {
- p->p_flag &= ~P_PROFIL;
+ atomic_clearbits_int(&p->p_flag, P_PROFIL);
if (--profprocs == 0 && stathz != 0) {
s = splstatclock();
psdiv = pscnt = 1;