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.
This commit is contained in:
christos 2003-09-16 12:04:58 +00:00
parent b99a361614
commit 3bb05d4a8c
2 changed files with 10 additions and 5 deletions

View File

@ -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 @@ struct ksiginfo {
int _fd;
} _poll;
} _reason;
struct ksiginfo *ksi_next;
struct ksiginfo *ksi_prev;
CIRCLEQ_ENTRY(ksiginfo) _list;
};
typedef union siginfo {
@ -125,6 +125,8 @@ typedef struct ksiginfo ksiginfo_t;
#define ksi_band _reason._poll._band
#define ksi_fd _reason._poll._fd
#define ksi_list _list
#endif
/** si_code */

View File

@ -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 @@ struct sigctx {
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