1999-09-24 23:26:23 +00:00
|
|
|
/*
|
2006-12-22 01:59:44 +00:00
|
|
|
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
|
1999-09-24 23:26:23 +00:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MPL-2.0
|
2021-06-03 08:37:05 +02:00
|
|
|
*
|
1999-09-24 23:26:23 +00:00
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
|
2018-02-23 09:53:12 +01:00
|
|
|
*
|
1999-09-24 23:26:23 +00:00
|
|
|
* See the COPYRIGHT file distributed with this work for additional
|
|
|
|
* information regarding copyright ownership.
|
|
|
|
*/
|
|
|
|
|
2021-10-05 16:49:47 +02:00
|
|
|
#pragma once
|
1999-09-24 23:26:23 +00:00
|
|
|
|
2006-12-22 01:46:19 +00:00
|
|
|
/*! \file isc/mutexblock.h */
|
2005-04-27 04:57:32 +00:00
|
|
|
|
1999-09-24 23:26:23 +00:00
|
|
|
#include <isc/mutex.h>
|
2000-04-26 01:29:27 +00:00
|
|
|
#include <isc/types.h>
|
1999-09-24 23:26:23 +00:00
|
|
|
|
2018-11-19 10:31:09 +00:00
|
|
|
void
|
1999-09-24 23:47:21 +00:00
|
|
|
isc_mutexblock_init(isc_mutex_t *block, unsigned int count);
|
2005-04-27 04:57:32 +00:00
|
|
|
/*%<
|
1999-09-24 23:26:23 +00:00
|
|
|
* Initialize a block of locks. If an error occurs all initialized locks
|
|
|
|
* will be destroyed, if possible.
|
|
|
|
*
|
|
|
|
* Requires:
|
|
|
|
*
|
2005-04-27 04:57:32 +00:00
|
|
|
*\li block != NULL
|
1999-09-24 23:26:23 +00:00
|
|
|
*
|
2005-04-27 04:57:32 +00:00
|
|
|
*\li count > 0
|
1999-09-24 23:26:23 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2018-11-19 10:31:09 +00:00
|
|
|
void
|
1999-09-24 23:47:21 +00:00
|
|
|
isc_mutexblock_destroy(isc_mutex_t *block, unsigned int count);
|
2005-04-27 04:57:32 +00:00
|
|
|
/*%<
|
1999-09-24 23:26:23 +00:00
|
|
|
* Destroy a block of locks.
|
|
|
|
*
|
|
|
|
* Requires:
|
|
|
|
*
|
2005-04-27 04:57:32 +00:00
|
|
|
*\li block != NULL
|
1999-09-24 23:26:23 +00:00
|
|
|
*
|
2005-04-27 04:57:32 +00:00
|
|
|
*\li count > 0
|
1999-09-24 23:26:23 +00:00
|
|
|
*
|
2005-04-27 04:57:32 +00:00
|
|
|
*\li Each lock in the block be initialized via isc_mutex_init() or
|
1999-09-24 23:26:23 +00:00
|
|
|
* the whole block was initialized via isc_mutex_initblock().
|
|
|
|
*
|
|
|
|
*/
|