#include <config.h>
#include <stddef.h>
#include <isc/atomic.h>
#include <isc/magic.h>
#include <isc/msgs.h>
#include <isc/platform.h>
#include <isc/rwlock.h>
#include <isc/util.h>
Go to the source code of this file.
Defines | |
#define | RWLOCK_MAGIC ISC_MAGIC('R', 'W', 'L', 'k') |
#define | VALID_RWLOCK(rwl) ISC_MAGIC_VALID(rwl, RWLOCK_MAGIC) |
Functions | |
isc_result_t | isc_rwlock_init (isc_rwlock_t *rwl, unsigned int read_quota, unsigned int write_quota) |
isc_result_t | isc_rwlock_lock (isc_rwlock_t *rwl, isc_rwlocktype_t type) |
isc_result_t | isc_rwlock_trylock (isc_rwlock_t *rwl, isc_rwlocktype_t type) |
isc_result_t | isc_rwlock_tryupgrade (isc_rwlock_t *rwl) |
void | isc_rwlock_downgrade (isc_rwlock_t *rwl) |
isc_result_t | isc_rwlock_unlock (isc_rwlock_t *rwl, isc_rwlocktype_t type) |
void | isc_rwlock_destroy (isc_rwlock_t *rwl) |
Definition in file rwlock.c.
#define RWLOCK_MAGIC ISC_MAGIC('R', 'W', 'L', 'k') |
#define VALID_RWLOCK | ( | rwl | ) | ISC_MAGIC_VALID(rwl, RWLOCK_MAGIC) |
Definition at line 34 of file rwlock.c.
Referenced by isc_rwlock_downgrade(), isc_rwlock_lock(), isc_rwlock_tryupgrade(), and isc_rwlock_unlock().
isc_result_t isc_rwlock_init | ( | isc_rwlock_t * | rwl, | |
unsigned int | read_quota, | |||
unsigned int | write_quota | |||
) |
Definition at line 724 of file rwlock.c.
References isc_rwlock::active, ISC_R_SUCCESS, isc_rwlocktype_read, isc_rwlock::magic, REQUIRE, RWLOCK_MAGIC, isc_rwlock::type, and UNUSED.
Referenced by create_stats(), dns_dbtable_create(), dns_fwdtable_create(), dns_keytable_create(), dns_ntatable_create(), dns_rbtdb_create(), dns_resolver_create(), dns_tsigkeyring_create(), dns_zonemgr_create(), dns_zt_create(), ISC_LIST(), and main().
isc_result_t isc_rwlock_lock | ( | isc_rwlock_t * | rwl, | |
isc_rwlocktype_t | type | |||
) |
Definition at line 740 of file rwlock.c.
References isc_rwlock::active, ISC_R_LOCKBUSY, ISC_R_SUCCESS, isc_rwlocktype_read, isc_rwlocktype_write, REQUIRE, isc_rwlock::type, and VALID_RWLOCK.
Referenced by copy_counters(), decrementcounter(), incrementcounter(), isc_rwlock_trylock(), isc_stats_set(), and keythatsigned().
isc_result_t isc_rwlock_trylock | ( | isc_rwlock_t * | rwl, | |
isc_rwlocktype_t | type | |||
) |
Definition at line 758 of file rwlock.c.
References isc_rwlock_lock().
Referenced by decrement_reference().
isc_result_t isc_rwlock_tryupgrade | ( | isc_rwlock_t * | rwl | ) |
Definition at line 763 of file rwlock.c.
References isc_rwlock::active, ISC_R_LOCKBUSY, ISC_R_SUCCESS, isc_rwlocktype_read, isc_rwlocktype_write, REQUIRE, isc_rwlock::type, and VALID_RWLOCK.
Referenced by decrement_reference().
void isc_rwlock_downgrade | ( | isc_rwlock_t * | rwl | ) |
Definition at line 779 of file rwlock.c.
References isc_rwlock::active, isc_rwlocktype_read, isc_rwlocktype_write, REQUIRE, isc_rwlock::type, and VALID_RWLOCK.
Referenced by decrement_reference().
isc_result_t isc_rwlock_unlock | ( | isc_rwlock_t * | rwl, | |
isc_rwlocktype_t | type | |||
) |
Definition at line 789 of file rwlock.c.
References isc_rwlock::active, INSIST, ISC_R_SUCCESS, REQUIRE, isc_rwlock::type, UNUSED, and VALID_RWLOCK.
Referenced by copy_counters(), decrementcounter(), incrementcounter(), isc_stats_set(), and keythatsigned().
void isc_rwlock_destroy | ( | isc_rwlock_t * | rwl | ) |
Definition at line 802 of file rwlock.c.
References isc_rwlock::active, isc_rwlock::magic, and REQUIRE.
Referenced by dbtable_free(), destroy(), destroyring(), dns_fwdtable_destroy(), dns_keytable_detach(), dns_ntatable_detach(), dns_rbtdb_create(), dns_resolver_create(), dns_tsigkeyring_create(), dns_zonemgr_create(), free_rbtdb(), isc_stats_detach(), zonemgr_free(), and zt_destroy().