Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern Set EV_ONESHOT to prevent rescheduling
details: https://anonhg.NetBSD.org/src/rev/46d17d89ac15
branches: trunk
changeset: 358662:46d17d89ac15
user: christos <christos%NetBSD.org@localhost>
date: Fri Jan 12 17:58:51 2018 +0000
description:
Set EV_ONESHOT to prevent rescheduling
XXX: pullup-8
diffstat:
sys/kern/kern_event.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diffs (31 lines):
diff -r 2df9f4fe71d0 -r 46d17d89ac15 sys/kern/kern_event.c
--- a/sys/kern/kern_event.c Fri Jan 12 17:54:36 2018 +0000
+++ b/sys/kern/kern_event.c Fri Jan 12 17:58:51 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_event.c,v 1.102 2018/01/09 03:31:13 christos Exp $ */
+/* $NetBSD: kern_event.c,v 1.103 2018/01/12 17:58:51 christos Exp $ */
/*-
* Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_event.c,v 1.102 2018/01/09 03:31:13 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_event.c,v 1.103 2018/01/12 17:58:51 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -710,6 +710,12 @@
filt_timerdetach(struct knote *kn)
{
callout_t *calloutp;
+ struct kqueue *kq = kn->kn_kq;
+
+ mutex_spin_enter(&kq->kq_lock);
+ /* prevent rescheduling when we expire */
+ kn->kn_flags |= EV_ONESHOT;
+ mutex_spin_exit(&kq->kq_lock);
calloutp = (callout_t *)kn->kn_hook;
callout_halt(calloutp, NULL);
Home |
Main Index |
Thread Index |
Old Index