diff --git a/include/ck_rwlock.h b/include/ck_rwlock.h index 3146f90..0b51b34 100644 --- a/include/ck_rwlock.h +++ b/include/ck_rwlock.h @@ -58,6 +58,15 @@ ck_rwlock_write_unlock(ck_rwlock_t *rw) return; } +CK_CC_INLINE static void +ck_rwlock_write_downgrade(ck_rwlock_t *rw) +{ + + ck_pr_inc_uint(&rw->n_readers); + ck_rwlock_write_unlock(rw); + return; +} + CK_CC_INLINE static bool ck_rwlock_write_trylock(ck_rwlock_t *rw, unsigned int factor) {