Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Add comment about locking.



details:   https://anonhg.NetBSD.org/src/rev/ff6b54c944d7
branches:  trunk
changeset: 750223:ff6b54c944d7
user:      rmind <rmind%NetBSD.org@localhost>
date:      Sun Dec 20 23:00:59 2009 +0000

description:
Add comment about locking.

diffstat:

 sys/kern/sys_select.c |  20 +++++++++++++++++---
 1 files changed, 17 insertions(+), 3 deletions(-)

diffs (37 lines):

diff -r 4a100f28c086 -r ff6b54c944d7 sys/kern/sys_select.c
--- a/sys/kern/sys_select.c     Sun Dec 20 20:42:23 2009 +0000
+++ b/sys/kern/sys_select.c     Sun Dec 20 23:00:59 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sys_select.c,v 1.20 2009/12/12 17:47:05 dsl Exp $      */
+/*     $NetBSD: sys_select.c,v 1.21 2009/12/20 23:00:59 rmind Exp $    */
 
 /*-
  * Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -66,11 +66,25 @@
  */
 
 /*
- * System calls relating to files.
+ * System calls of synchronous I/O multiplexing subsystem.
+ *
+ * Locking
+ *
+ * Two locks are used: <object-lock> and selcpu_t::sc_lock.
+ *
+ * The <object-lock> might be a device driver or another subsystem, e.g.
+ * socket or pipe.  This lock is not exported, and thus invisible to this
+ * subsystem.  Mainly, synchronisation between selrecord() and selnotify()
+ * routines depends on this lock, as it will be described in the comments.
+ *
+ * Lock order
+ *
+ *     <object-lock> ->
+ *             selcpu_t::sc_lock
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sys_select.c,v 1.20 2009/12/12 17:47:05 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_select.c,v 1.21 2009/12/20 23:00:59 rmind Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>



Home | Main Index | Thread Index | Old Index