From 8a38bc6b2ce7980dbddef0dc33bfba51ec5d3824 Mon Sep 17 00:00:00 2001 From: alc Date: Tue, 27 Jul 2004 03:53:41 +0000 Subject: - Use atomic ops for updating the vmspace's refcnt and exitingcnt. - Push down Giant into shmexit(). (Giant is acquired only if the vmspace contains shm segments.) - Eliminate the acquisition of Giant from proc_rwmem(). - Reduce the scope of Giant in exit1(), uncovering the destruction of the address space. --- sys/kern/sysv_shm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/kern/sysv_shm.c') diff --git a/sys/kern/sysv_shm.c b/sys/kern/sysv_shm.c index 1430942..0b016f1 100644 --- a/sys/kern/sysv_shm.c +++ b/sys/kern/sysv_shm.c @@ -822,14 +822,14 @@ shmexit_myhook(struct vmspace *vm) struct shmmap_state *base, *shm; int i; - GIANT_REQUIRED; - if ((base = vm->vm_shm) != NULL) { vm->vm_shm = NULL; + mtx_lock(&Giant); for (i = 0, shm = base; i < shminfo.shmseg; i++, shm++) { if (shm->shmid != -1) shm_delete_mapping(vm, shm); } + mtx_unlock(&Giant); free(base, M_SHM); } } -- cgit v1.1