mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 14:35:26 +00:00
Use simple pthread_rwlock in place of our custom adaptive rwlock
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
#define ISC_RWLOCK_H 1
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <pthread.h>
|
||||
|
||||
/*! \file isc/rwlock.h */
|
||||
|
||||
@@ -31,6 +32,14 @@ typedef enum {
|
||||
isc_rwlocktype_write
|
||||
} isc_rwlocktype_t;
|
||||
|
||||
#if HAVE_PTHREAD_RWLOCK_RDLOCK
|
||||
|
||||
struct isc_rwlock {
|
||||
pthread_rwlock_t rwlock;
|
||||
};
|
||||
|
||||
#else /* HAVE_PTHREAD_RWLOCK_RDLOCK */
|
||||
|
||||
struct isc_rwlock {
|
||||
/* Unlocked. */
|
||||
unsigned int magic;
|
||||
@@ -68,6 +77,8 @@ struct isc_rwlock {
|
||||
|
||||
};
|
||||
|
||||
#endif /* HAVE_PTHREAD_RWLOCK_RDLOCK */
|
||||
|
||||
isc_result_t
|
||||
isc_rwlock_init(isc_rwlock_t *rwl, unsigned int read_quota,
|
||||
unsigned int write_quota);
|
||||
|
Reference in New Issue
Block a user