summaryrefslogtreecommitdiff
path: root/libports/destroy-right.c
diff options
context:
space:
mode:
Diffstat (limited to 'libports/destroy-right.c')
-rw-r--r--libports/destroy-right.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libports/destroy-right.c b/libports/destroy-right.c
index 65e19c78..448b3798 100644
--- a/libports/destroy-right.c
+++ b/libports/destroy-right.c
@@ -30,12 +30,13 @@ ports_destroy_right (void *portstruct)
if (pi->port_right != MACH_PORT_NULL)
{
- pthread_mutex_lock (&_ports_lock);
+ pthread_rwlock_wrlock (&_ports_htable_lock);
+ hurd_ihash_locp_remove (&_ports_htable, pi->ports_htable_entry);
hurd_ihash_locp_remove (&pi->bucket->htable, pi->hentry);
+ pthread_rwlock_unlock (&_ports_htable_lock);
err = mach_port_mod_refs (mach_task_self (), pi->port_right,
MACH_PORT_RIGHT_RECEIVE, -1);
assert_perror (err);
- pthread_mutex_unlock (&_ports_lock);
pi->port_right = MACH_PORT_NULL;