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