summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1996-01-30 20:02:42 +0000
committerMichael I. Bushnell <mib@gnu.org>1996-01-30 20:02:42 +0000
commitb5c0c2c14c611344c1314008991679f41bfe38f1 (patch)
tree87a39074f0c74ef091b840afc9b6e5efead5f910
parentb80b73f95e70be123bc1dc06e5567e63ca85ce3c (diff)
Formerly release-peropen.c.~2~
-rw-r--r--libnetfs/release-peropen.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/libnetfs/release-peropen.c b/libnetfs/release-peropen.c
index 4fe479bf..c5565b23 100644
--- a/libnetfs/release-peropen.c
+++ b/libnetfs/release-peropen.c
@@ -23,7 +23,13 @@
void
netfs_release_peropen (struct peropen *po)
{
- mach_port_deallocate (mach_task_self (), dotdotport);
- netfs_nrele (po->np);
- free (po);
+ mutex_lock (&po->np->lock);
+ if (--po->refcnt)
+ mutex_unlock (&po->np->lock);
+ else
+ {
+ mach_port_deallocate (mach_task_self (), dotdotport);
+ netfs_nput (po->np);
+ free (po);
+ }
}