summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1995-03-30 17:37:43 +0000
committerMichael I. Bushnell <mib@gnu.org>1995-03-30 17:37:43 +0000
commit2ec316a71e7f48e53fbfbfe99998f09e67a523ad (patch)
tree0d7821b6b819f1178f06579552dd1436c857a955
parent819a5d5ee8ebf6521408ccbad8e71b8db49009f9 (diff)
(trivfs_clean_protid): Lock CRED->po->cntl->lock around relevant code.
-rw-r--r--libtrivfs/protid-clean.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libtrivfs/protid-clean.c b/libtrivfs/protid-clean.c
index 192aa930..76d79968 100644
--- a/libtrivfs/protid-clean.c
+++ b/libtrivfs/protid-clean.c
@@ -1,5 +1,5 @@
/*
- Copyright (C) 1994 Free Software Foundation
+ Copyright (C) 1994, 1995 Free Software Foundation
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@@ -26,6 +26,7 @@ trivfs_clean_protid (void *arg)
if (trivfs_protid_destroy_hook)
(*trivfs_protid_destroy_hook) (cred);
+ mutex_lock (&cred->po->cntl->lock);
if (!cred->po->refcnt--)
{
if (trivfs_peropen_destroy_hook)
@@ -33,6 +34,7 @@ trivfs_clean_protid (void *arg)
ports_done_with_port (cred->po->cntl);
free (cred->po);
}
+ mutex_unlock (&cred->po->cntl->lock);
free (cred->uids);
free (cred->gids);
mach_port_deallocate (mach_task_self (), cred->realnode);