Eliminate semexit_hook using at_exit(9) and rm_at_exit(9).

Reviewed by:	alfred
This commit is contained in:
Alan Cox 2001-12-30 18:55:09 +00:00
parent 881c9063c7
commit 477b78a0df
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=88715
4 changed files with 2 additions and 20 deletions

View File

@ -209,11 +209,6 @@ exit1(td, rv)
}
PROC_UNLOCK(p->p_leader);
/*
* XXX Shutdown SYSV semaphores
*/
semexit(p);
/* The next two chunks should probably be moved to vmspace_exit. */
vm = p->p_vmspace;
/*

View File

@ -41,21 +41,9 @@
#include <sys/proc.h>
#include <sys/ucred.h>
void (*semexit_hook)(struct proc *) = NULL;
void (*shmfork_hook)(struct proc *, struct proc *) = NULL;
void (*shmexit_hook)(struct proc *) = NULL;
/* called from kern_exit.c */
void
semexit(p)
struct proc *p;
{
if (semexit_hook != NULL)
semexit_hook(p);
return;
}
/* called from kern_fork.c */
void
shmfork(p1, p2)

View File

@ -202,7 +202,7 @@ seminit(void)
suptr->un_proc = NULL;
}
semu_list = NULL;
semexit_hook = &semexit_myhook;
at_exit(semexit_myhook);
}
static int
@ -215,7 +215,7 @@ semunload(void)
free(sem, M_SEM);
free(sema, M_SEM);
free(semu, M_SEM);
semexit_hook = NULL;
rm_at_exit(semexit_myhook);
return (0);
}

View File

@ -87,7 +87,6 @@ struct thread;
struct proc;
int ipcperm __P((struct thread *, struct ipc_perm *, int));
extern void (*semexit_hook)(struct proc *);
extern void (*shmfork_hook)(struct proc *, struct proc *);
extern void (*shmexit_hook)(struct proc *);