Source-Changes-HG archive

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

[src/trunk]: src/sys/sys convert to use <queue.h> and add a lock for siginfo ...



details:   https://anonhg.NetBSD.org/src/rev/6c48e3006a67
branches:  trunk
changeset: 552022:6c48e3006a67
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Sep 16 12:04:58 2003 +0000

description:
convert to use <queue.h> and add a lock for siginfo circleq.
XXX: could use STAILQ, but there is no way to remove an element without
rescanning the queue. We should really add a special iterator that can
do this.

diffstat:

 sys/sys/siginfo.h   |  8 +++++---
 sys/sys/signalvar.h |  7 +++++--
 2 files changed, 10 insertions(+), 5 deletions(-)

diffs (64 lines):

diff -r f81bdb75599f -r 6c48e3006a67 sys/sys/siginfo.h
--- a/sys/sys/siginfo.h Tue Sep 16 11:55:17 2003 +0000
+++ b/sys/sys/siginfo.h Tue Sep 16 12:04:58 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: siginfo.h,v 1.3 2003/09/14 07:00:45 christos Exp $      */
+/*     $NetBSD: siginfo.h,v 1.4 2003/09/16 12:04:58 christos Exp $      */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -40,6 +40,7 @@
 #define        _SYS_SIGINFO_H_
 
 #include <machine/signal.h>    /* XXX: __HAVE_SIGINFO */
+#include <sys/queue.h>
 
 typedef union sigval {
        int     sival_int;
@@ -79,8 +80,7 @@
                        int     _fd;
                } _poll;
        } _reason;
-       struct ksiginfo *ksi_next;
-       struct ksiginfo *ksi_prev;
+       CIRCLEQ_ENTRY(ksiginfo) _list;
 };
 
 typedef union siginfo {
@@ -125,6 +125,8 @@
 
 #define        ksi_band        _reason._poll._band
 #define        ksi_fd          _reason._poll._fd
+
+#define        ksi_list        _list
 #endif
 
 /** si_code */
diff -r f81bdb75599f -r 6c48e3006a67 sys/sys/signalvar.h
--- a/sys/sys/signalvar.h       Tue Sep 16 11:55:17 2003 +0000
+++ b/sys/sys/signalvar.h       Tue Sep 16 12:04:58 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: signalvar.h,v 1.43 2003/09/14 07:00:46 christos Exp $  */
+/*     $NetBSD: signalvar.h,v 1.44 2003/09/16 12:04:58 christos Exp $  */
 
 /*
  * Copyright (c) 1991, 1993
@@ -34,6 +34,8 @@
 #ifndef        _SYS_SIGNALVAR_H_               /* tmp for user.h */
 #define        _SYS_SIGNALVAR_H_
 
+#include <sys/lock.h>
+#include <sys/queue.h>
 /*
  * Kernel signal definitions and data structures,
  * not exported to user programs.
@@ -61,7 +63,8 @@
        char    ps_sigcheck;            /* May have deliverable signals. */
        int     ps_sigwaited;           /* Delivered signal from wait set */
        sigset_t ps_sigwait;            /* Signals being waited for */
-       struct ksiginfo *ps_siginfo;    /* for SA_SIGINFO */
+       struct simplelock ps_silock;    /* Lock for ps_siginfo */
+       CIRCLEQ_HEAD(, ksiginfo) ps_siginfo;/* for SA_SIGINFO */
 
        /* This should be copied on fork */
 #define        ps_startcopy    ps_sigstk



Home | Main Index | Thread Index | Old Index