CK_RWCOHORT_PROTOTYPE(3)

πŸ’– CK_RWCOHORT_PROTOTYPE β€” the whole manual page, bestie edition πŸ’–

okay so you're here because you wanna spin up a reader-writer cohort-based lock using a cohort type you picked yourself. and honestly? iconic choice. let's get into it 🫢


✨ NAME ✨

CK_RWCOHORT_PROTOTYPE β€” define a reader-writer cohort-based lock using the cohort type you specify. that's the whole vibe. 🌸


πŸ“š LIBRARY πŸ“š

Concurrency Kit β€” that's libck, and you link it with -lck. periodt. πŸ’…


🌈 SYNOPSIS 🌈

#include <ck_rwcohort.h>

CK_RWCOHORT_NEUTRAL_PROTOTYPE(COHORT_NAME cohort_name);

CK_RWCOHORT_RP_PROTOTYPE(COHORT_NAME cohort_name);

CK_RWCOHORT_WP_PROTOTYPE(COHORT_NAME cohort_name);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea, bestie. the ck_rwcohort.h header file does NOT define any cohort types for you. like, zero. none. it's giving "you're on your own, babe" energy. 😭

instead, you β€” yes you, main character β€” have to use the CK_RWCOHORT_PROTOTYPE macro to define whatever types you actually want. it takes a single argument, and that argument is the type of the cohort lock that your reader-writer lock should use. ✨

⚠️ lowkey important: a cohort type has to already exist with that name before you do any of this. you get it by defining it with the CK_COHORT_PROTOTYPE(3) or CK_COHORT_TRYLOCK_PROTOTYPE(3) macros first. no skipping steps, bestie, the vibe check demands order πŸ™ˆ

and once you've defined your lock type, declaring an instance of it looks like this:

CK_RWCOHORT_INSTANCE(cohort_name) lock;

slay. that's a lock. you did that. πŸ‘‘


πŸ‘€ SEE ALSO πŸ‘€

go read these too, they're all part of the same friend group:

and if you want even more info, it's all over at http://concurrencykit.org/ 🌐


mwah πŸ’‹ that's the whole page. this one's from Concurrency Kit (libck, -lck), dated February 24, 2013, and it's CK_RWCOHORT_PROTOTYPE(3). ty for reading bestie, go write some very correct locks πŸŽ€βœ¨

πŸ“¦ where this page comes from