PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP

This commit is contained in:
Witold Kręcicki
2020-02-24 17:04:48 +01:00
parent fbc2f8bc56
commit d1d9846cfd
+4 -1
View File
@@ -36,7 +36,10 @@ isc_rwlock_init(isc_rwlock_t *rwl, unsigned int read_quota,
unsigned int write_quota) {
UNUSED(read_quota);
UNUSED(write_quota);
REQUIRE(pthread_rwlock_init(&rwl->rwlock, NULL) == 0);
pthread_rwlockattr_t rwlockattr;
pthread_rwlockattr_init(&rwlockattr);
pthread_rwlockattr_setkind_np(&rwlockattr, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP);
REQUIRE(pthread_rwlock_init(&rwl->rwlock, &rwlockattr) == 0);
atomic_init(&rwl->downgrade, false);
return (ISC_R_SUCCESS);
}