From d76e25773dd5607845469c34b6df0b2619541613 Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Fri, 21 Jul 1995 21:53:35 +0000 Subject: (_ports_complete_deallocate): Clear PI->port_right; and do it before releasing _ports_lock. --- libports/complete-deallocate.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libports') diff --git a/libports/complete-deallocate.c b/libports/complete-deallocate.c index c663cdfe..a0e4e7e0 100644 --- a/libports/complete-deallocate.c +++ b/libports/complete-deallocate.c @@ -35,11 +35,12 @@ _ports_complete_deallocate (struct port_info *pi) pi->bucket->count--; pi->class->count--; - mutex_unlock (&_ports_lock); mach_port_mod_refs (mach_task_self (), pi->port_right, MACH_PORT_RIGHT_RECEIVE, -1); - + pi->port_right = MACH_PORT_NULL; + mutex_unlock (&_ports_lock); + if (pi->class->clean_routine) (*pi->class->clean_routine)(pi); -- cgit v1.2.3