diff options
author | alfred <alfred@FreeBSD.org> | 2002-05-01 20:44:46 +0000 |
---|---|---|
committer | alfred <alfred@FreeBSD.org> | 2002-05-01 20:44:46 +0000 |
commit | 798c53d495a4eb1c10dc65a1d2ca87e2cb12f8df (patch) | |
tree | 47fe7acf6ad89bf88d96ff3e57b5a8e31207cbf6 /sys/kern/kern_sig.c | |
parent | 97feabed08c26b8c53c3d7fd222d27f5c7433f82 (diff) | |
download | FreeBSD-src-798c53d495a4eb1c10dc65a1d2ca87e2cb12f8df.zip FreeBSD-src-798c53d495a4eb1c10dc65a1d2ca87e2cb12f8df.tar.gz |
Redo the sigio locking.
Turn the sigio sx into a mutex.
Sigio lock is really only needed to protect interrupts from dereferencing
the sigio pointer in an object when the sigio itself is being destroyed.
In order to do this in the most unintrusive manner change pgsigio's
sigio * argument into a **, that way we can lock internally to the
function.
Diffstat (limited to 'sys/kern/kern_sig.c')
-rw-r--r-- | sys/kern/kern_sig.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 16c6fed..4c1b683 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -2087,13 +2087,18 @@ nosys(td, args) * stored credentials rather than those of the current process. */ void -pgsigio(sigio, sig, checkctty) - struct sigio *sigio; +pgsigio(sigiop, sig, checkctty) + struct sigio **sigiop; int sig, checkctty; { - if (sigio == NULL) - return; + struct sigio *sigio; + SIGIO_LOCK(); + sigio = *sigiop; + if (sigio == NULL) { + SIGIO_UNLOCK(); + return; + } if (sigio->sio_pgid > 0) { PROC_LOCK(sigio->sio_proc); if (CANSIGIO(sigio->sio_ucred, sigio->sio_proc->p_ucred)) @@ -2112,6 +2117,7 @@ pgsigio(sigio, sig, checkctty) } PGRP_UNLOCK(sigio->sio_pgrp); } + SIGIO_UNLOCK(); } static int |