CK_RWCOHORT_WRITE_LOCK(3)

✨ NAME ✨

CK_RWCOHORT_WRITE_LOCK β€” bestie, this is how you acquire write access for a cohort-based reader-writer lock πŸ’…

(ngl the original page spells it "acquite" and we're keeping that energy, it's giving iconic typo πŸŽ€)


πŸ“š LIBRARY πŸ“š

Concurrency Kit β€” that's libck, link it with -lck 🫢


🌸 SYNOPSIS 🌸

#include <ck_cohort.h>

CK_RWCOHORT_NEUTRAL_WRITE_LOCK(COHORT_NAME cohort_name, LOCK *lock,
    COHORT *cohort"void *global_context, void *local_context);

CK_RWCOHORT_RP_WRITE_LOCK(COHORT_NAME cohort_name, LOCK *lock,
    COHORT *cohort"void *global_context, void *local_context);

CK_RWCOHORT_WP_WRITE_LOCK(COHORT_NAME cohort_name, LOCK *lock,
    COHORT *cohort"void *global_context, void *local_context);

Three flavors, one vibe: NEUTRAL, RP, and WP. Pick the one that matches your cohort, queen πŸ‘‘


πŸ’– DESCRIPTION πŸ’–

okay so. This call acquires write permission for lock. πŸ¦‹

The call will block until that permission has actually been acquired β€” so yeah, it's gonna sit there and wait its turn, no cap. ⏳

cohort must point to a cohort whose global lock is the same as all the other cohorts used with lock. Fr fr, this is the part you don't wanna mess up β€” if the global locks don't match, that's not it. 😭

The global_context and local_context arguments get passed along as the context arguments to any calls to cohort. So they ride along with the cohort, like a little bestie entourage πŸ’–βœ¨

⚠️ heads up: cohort must point to a cohort whose global lock is the same as all other cohorts used with lock. This is not a vibe-check-optional situation, bestie.

πŸ‘€ SEE ALSO πŸ‘€

More tea, more lore, all the extra info is available at http://concurrencykit.org/ 🌈


k bye, this page was served fresh on February 24, 2013. and it's filed under CK_RWCOHORT_WRITE_LOCK(3) β€” slay, lock well, and may your write access always come through πŸ’œπŸ§š

πŸ“¦ where this page comes from