summaryrefslogtreecommitdiff
path: root/libports/claim-right.c
diff options
context:
space:
mode:
Diffstat (limited to 'libports/claim-right.c')
-rw-r--r--libports/claim-right.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libports/claim-right.c b/libports/claim-right.c
index 4851ea3c..85592ff0 100644
--- a/libports/claim-right.c
+++ b/libports/claim-right.c
@@ -34,10 +34,13 @@ ports_claim_right (void *portstruct)
if (ret == MACH_PORT_NULL)
return ret;
- 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_move_member (mach_task_self (), ret, MACH_PORT_NULL);
assert_perror (err);
+ pthread_mutex_lock (&_ports_lock);
pi->port_right = MACH_PORT_NULL;
if (pi->flags & PORT_HAS_SENDRIGHTS)
{