Actually implement prop_dictionary_make_immutable. OK'd by thorpej@.

This commit is contained in:
cube 2008-03-05 07:47:09 +00:00
parent 4902571538
commit 5b25d80ca0
1 changed files with 15 additions and 1 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: prop_dictionary.c,v 1.22 2008/01/05 01:15:02 ad Exp $ */
/* $NetBSD: prop_dictionary.c,v 1.23 2008/03/05 07:47:09 cube Exp $ */
/*-
* Copyright (c) 2006, 2007 The NetBSD Foundation, Inc.
@ -695,6 +695,20 @@ prop_dictionary_copy_mutable(prop_dictionary_t opd)
return (pd);
}
/*
* prop_dictionary_make_immutable --
* Set the immutable flag on that dictionary.
*/
void
prop_dictionary_make_immutable(prop_dictionary_t pd)
{
_PROP_RWLOCK_WRLOCK(pd->pd_rwlock);
if (prop_dictionary_is_immutable(pd) == false)
pd->pd_flags |= PD_F_IMMUTABLE;
_PROP_RWLOCK_UNLOCK(pd->pd_rwlock);
}
/*
* prop_dictionary_count --
* Return the number of objects stored in the dictionary.