CK_RWCOHORT_WRITE_UNLOCK(3)

πŸ’– CK_RWCOHORT_WRITE_UNLOCK β€” relinquish write access for cohort-based reader-writer lock πŸ’–

okay bestie, this one lives in the Concurrency Kit, aka libck, so link it with -lck and you're golden ✨


🌸 SYNOPSIS 🌸

#include <ck_cohort.h>

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

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

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

like yes, that's three whole flavors of the same vibe β€” NEUTRAL, RP and WP β€” pick the one that matches how you set your cohort up πŸ¦‹


✨ DESCRIPTION ✨

so this call relinquishes write permission for lock. that's it, that's the whole job, and honestly? she ate πŸ’…

cohort has to point to a cohort whose global lock is the same as every other cohort you use with lock. like, they all gotta be in the same friend group, no cap. if they're not matching up, you're not doing the thing right 😭

and the global_context and local_context args? they get passed along as the context arguments to any calls to cohort. so whatever you hand over here, cohort's gonna see it. keep that in mind, bestie 🫢

lowkey important: this is the unlock half of the write-lock story. you only call it if you already grabbed write access, fr fr.

πŸ‘€ SEE ALSO πŸ‘€

the whole squad, go read them:

and if you want even more lore, it's all sitting at http://concurrencykit.org/ 🧚


okay that's the whole page, mwah πŸ’‹ this one's dated February 24, 2013. and it comes to you from Concurrency Kit β€” CK_RWCOHORT_WRITE_UNLOCK(3), section 3, periodt πŸ‘‘

πŸ“¦ where this page comes from