summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/kern/kern_clock.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c
index 17b85bc..e7a7a99 100644
--- a/sys/kern/kern_clock.c
+++ b/sys/kern/kern_clock.c
@@ -570,9 +570,11 @@ hardclock_cnt(int cnt, int usermode)
flags |= TDF_PROFPEND | TDF_ASTPENDING;
PROC_ITIMUNLOCK(p);
}
- thread_lock(td);
- td->td_flags |= flags;
- thread_unlock(td);
+ if (flags != 0) {
+ thread_lock(td);
+ td->td_flags |= flags;
+ thread_unlock(td);
+ }
#ifdef HWPMC_HOOKS
if (PMC_CPU_HAS_SAMPLES(PCPU_GET(cpuid)))
OpenPOWER on IntegriCloud