summaryrefslogtreecommitdiff
path: root/libports/ports.h
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2014-05-03 01:02:35 +0200
committerJustus Winter <4winter@informatik.uni-hamburg.de>2014-10-05 23:31:08 +0200
commit78343e97c68fda079c66f2443bab6d1ee16f0b67 (patch)
treec2293ad70042bf6d839ab6ef5436e4c9fdf2cdcc /libports/ports.h
parent9a043bf1792be16a045dd2e2e37c2c6354425b9b (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 'libports/ports.h')
-rw-r--r--libports/ports.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/libports/ports.h b/libports/ports.h
index 8118de9e..652edb88 100644
--- a/libports/ports.h
+++ b/libports/ports.h
@@ -27,6 +27,7 @@
#include <hurd/ihash.h>
#include <mach/notify.h>
#include <pthread.h>
+#include <refcount.h>
/* These are global values for common flags used in the various structures.
Not all of these are meaningful in all flag fields. */
@@ -39,8 +40,7 @@
struct port_info
{
struct port_class *class;
- int refcnt;
- int weakrefcnt;
+ refcounts_t refcounts;
mach_port_mscount_t mscount;
mach_msg_seqno_t cancel_threshold;
int flags;