xref: /netbsd-src/external/mpl/dhcp/bind/dist/lib/isc/mutexblock.c (revision 4afad4b7fa6d4a0d3dedf41d1587a7250710ae54)
1 /*	$NetBSD: mutexblock.c,v 1.1 2024/02/18 20:57:49 christos Exp $	*/
2 
3 /*
4  * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
5  *
6  * SPDX-License-Identifier: MPL-2.0
7  *
8  * This Source Code Form is subject to the terms of the Mozilla Public
9  * License, v. 2.0. If a copy of the MPL was not distributed with this
10  * file, you can obtain one at https://mozilla.org/MPL/2.0/.
11  *
12  * See the COPYRIGHT file distributed with this work for additional
13  * information regarding copyright ownership.
14  */
15 
16 /*! \file */
17 
18 #include <isc/mutexblock.h>
19 #include <isc/util.h>
20 
21 void
isc_mutexblock_init(isc_mutex_t * block,unsigned int count)22 isc_mutexblock_init(isc_mutex_t *block, unsigned int count) {
23 	unsigned int i;
24 
25 	for (i = 0; i < count; i++) {
26 		isc_mutex_init(&block[i]);
27 	}
28 }
29 
30 void
isc_mutexblock_destroy(isc_mutex_t * block,unsigned int count)31 isc_mutexblock_destroy(isc_mutex_t *block, unsigned int count) {
32 	unsigned int i;
33 
34 	for (i = 0; i < count; i++) {
35 		isc_mutex_destroy(&block[i]);
36 	}
37 }
38