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 theCK_COHORT_PROTOTYPE(3)orCK_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:
ck_rwcohort(3)CK_COHORT_PROTOTYPE(3)CK_COHORT_TRYLOCK_PROTOTYPE(3)CK_RWCOHORT_INSTANCE(3)CK_RWCOHORT_INITIALIZER(3)CK_RWCOHORT_INIT(3)CK_RWCOHORT_READ_LOCK(3)CK_RWCOHORT_READ_UNLOCK(3)CK_RWCOHORT_WRITE_LOCK(3)CK_RWCOHORT_WRITE_UNLOCK(3)
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
- alpine 3.24: ck-doc 0.7.2-r1 Β· BSD-2-Clause AND Apache-2.0
- debian bookworm: libck-dev 0.7.1-10 Β· BSD-2-Clause
- debian trixie: libck-dev 0.7.2-6 Β· BSD-2-Clause
- epel 10: ck-devel 0.7.2-1.el10_1 Β· BSD-2-clause AND Apache-2.0 AND BSD-3-clause
- epel 9: ck-devel 0.7.0-10.el9 Β· BSD
- fedora 43: ck-devel 0.7.2-2.fc43 Β· BSD-2-clause AND Apache-2.0 AND BSD-3-clause
- fedora 43: ck-devel 0.7.2-2.fc43 Β· BSD-2-clause AND Apache-2.0 AND BSD-3-clause
- fedora 44: ck-devel 0.7.2-4.fc44 Β· BSD-2-clause AND Apache-2.0 AND BSD-3-clause
- fedora 44: ck-devel 0.7.2-4.fc44 Β· BSD-2-clause AND Apache-2.0 AND BSD-3-clause
- nixos 26.05: ck 0.7.2
- nixpkgs unstable: ck 0.7.2
- opensuse-leap 16.0: ck-devel 0.7.2-bp160.1.9 Β· Apache-2.0 AND BSD-2-Clause
- opensuse-leap 16.0: ck-devel 0.7.2-bp160.1.9 Β· Apache-2.0 AND BSD-2-Clause
- opensuse-leap 16.0: ck-devel 0.7.2-bp160.1.9 Β· Apache-2.0 AND BSD-2-Clause
- ubuntu jammy: libck-dev 0.7.1-6ubuntu2 Β· BSD-2-Clause
- ubuntu noble: libck-dev 0.7.1-13build1 Β· BSD-2-Clause
- ubuntu questing: libck-dev 0.7.2-5ubuntu1
- ubuntu resolute: libck-dev 0.7.2-5ubuntu2 Β· BSD-2-Clause
- ubuntu stonking: libck-dev 0.7.2-11 Β· BSD-2-Clause
- Copyright 2013 Brendon Scheinman
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms