ck_rwlock: Add ck_rwlock_write_downgrade.

This function allows the writer to downgrade to shared access
atomically.
ck_pring
Samy Al Bahra 13 years ago
parent 0231b68a8b
commit 50f6f6ee02

@ -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)
{

Loading…
Cancel
Save