diff options
-rw-r--r-- | libmom/copy-ref.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/libmom/copy-ref.c b/libmom/copy-ref.c index f0d37954..03d4ab45 100644 --- a/libmom/copy-ref.c +++ b/libmom/copy-ref.c @@ -26,18 +26,9 @@ mom_copy_ref (struct mom_port_ref *new, { error_t err; - new->lock = SPIN_LOCK_INITIALIZER; - - spin_lock (&obj->lock); - assert (obj->refcnt); err = mach_port_mod_refs (mach_task_self (), obj->port, MACH_PORT_RIGHT_SEND, 1); - new->port = obj->port; - spin_unlock (&obj->lock); - - if (err) - return err; - - new->refcnt = 1; - return 0; + if (!err) + new->port = obj->port; + return err; } |