From 5b25d80ca019ba6936951a0d4991d16c4a014635 Mon Sep 17 00:00:00 2001 From: cube Date: Wed, 5 Mar 2008 07:47:09 +0000 Subject: [PATCH] Actually implement prop_dictionary_make_immutable. OK'd by thorpej@. --- common/lib/libprop/prop_dictionary.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/common/lib/libprop/prop_dictionary.c b/common/lib/libprop/prop_dictionary.c index 115899441381..71a728d48477 100644 --- a/common/lib/libprop/prop_dictionary.c +++ b/common/lib/libprop/prop_dictionary.c @@ -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.