From 2ec316a71e7f48e53fbfbfe99998f09e67a523ad Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Thu, 30 Mar 1995 17:37:43 +0000 Subject: (trivfs_clean_protid): Lock CRED->po->cntl->lock around relevant code. --- libtrivfs/protid-clean.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libtrivfs') 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); -- cgit v1.2.3