Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/sys Add a clarifying comment about it being safe to modi...



details:   https://anonhg.NetBSD.org/src/rev/ae25638bc797
branches:  trunk
changeset: 1024138:ae25638bc797
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Mon Oct 11 01:21:28 2021 +0000

description:
Add a clarifying comment about it being safe to modify knote::kn_flags
without synchronization in the filter attach routine.  This is safe
because the knote has not yet been published, and is typically used to
force EV_CLEAR and/or EV_ONESHOT on that filter's knotes.

diffstat:

 sys/sys/event.h |  8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diffs (22 lines):

diff -r 7e51afa0831c -r ae25638bc797 sys/sys/event.h
--- a/sys/sys/event.h   Mon Oct 11 01:07:36 2021 +0000
+++ b/sys/sys/event.h   Mon Oct 11 01:21:28 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: event.h,v 1.46 2021/10/11 01:07:36 thorpej Exp $       */
+/*     $NetBSD: event.h,v 1.47 2021/10/11 01:21:28 thorpej Exp $       */
 
 /*-
  * Copyright (c) 1999,2000,2001 Jonathan Lemon <jlemon%FreeBSD.org@localhost>
@@ -267,6 +267,12 @@
     "\7WILLDETACH"
 
 
+/*
+ * The only time knote::kn_flags can be modified without synchronization
+ * is during filter attach, because the knote has not yet been published.
+ * This is usually to set EV_CLEAR or EV_ONESHOT as mandatory flags for
+ * that filter.
+ */
 #define        kn_id           kn_kevent.ident
 #define        kn_filter       kn_kevent.filter
 #define        kn_flags        kn_kevent.flags         /* q */



Home | Main Index | Thread Index | Old Index