diff options
author | Justus Winter <4winter@informatik.uni-hamburg.de> | 2014-05-03 01:02:35 +0200 |
---|---|---|
committer | Justus Winter <4winter@informatik.uni-hamburg.de> | 2014-10-05 23:31:08 +0200 |
commit | 78343e97c68fda079c66f2443bab6d1ee16f0b67 (patch) | |
tree | c2293ad70042bf6d839ab6ef5436e4c9fdf2cdcc /utils/rpctrace.c | |
parent | 9a043bf1792be16a045dd2e2e37c2c6354425b9b (diff) |
libports: lock-less reference counting for port_info objects
* libports/ports.h (struct port_info): Use the new type.
* libports/lookup-port.c: No need to lock _ports_lock anymore.
* libports/bucket-iterate.c: Likewise.
* libports/complete-deallocate.c: Check if someone reacquired a
reference through a hash table lookup.
* libports/create-internal.c: Use the new reference counting primitives.
* libports/get-right.c: Likewise.
* libports/import-port.c: Likewise.
* libports/port-deref-weak.c: Likewise.
* libports/port-deref.c: Likewise.
* libports/port-ref-weak.c: Likewise.
* libports/port-ref.c: Likewise.
* libports/reallocate-from-external.c: Likewise.
* libports/transfer-right.c: Likewise.
* utils/rpctrace.c: Likewise.
Diffstat (limited to 'utils/rpctrace.c')
-rw-r--r-- | utils/rpctrace.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/utils/rpctrace.c b/utils/rpctrace.c index fc913e30..b11fea40 100644 --- a/utils/rpctrace.c +++ b/utils/rpctrace.c @@ -431,7 +431,9 @@ destroy_receiver_info (struct receiver_info *info) while (send_wrapper) { struct sender_info *next = send_wrapper->next; - assert (TRACED_INFO (send_wrapper)->pi.refcnt == 1); + assert ( + refcounts_hard_references (&TRACED_INFO (send_wrapper)->pi.refcounts) + == 1); /* Reset the receive_right of the send wrapper in advance to avoid * destroy_receiver_info is called when the port info is destroyed. */ send_wrapper->receive_right = NULL; @@ -848,7 +850,11 @@ rewrite_right (mach_port_t *right, mach_msg_type_name_t *type, hurd_ihash_locp_remove (&traced_names, receiver_info->locp); send_wrapper2 = get_send_wrapper (receiver_info, dest, &rr); - assert (TRACED_INFO (send_wrapper2)->pi.refcnt == 1); + assert ( + refcounts_hard_references ( + &TRACED_INFO (send_wrapper2)->pi.refcounts) + == 1); + name = TRACED_INFO (send_wrapper2)->name; TRACED_INFO (send_wrapper2)->name = NULL; /* send_wrapper2 isn't destroyed normally, so we need to unlink |