CK_COHORT_INSTANCE(3)
π CK_COHORT_INSTANCE β declare an instance of a cohort type π
okay bestie, so this one is short but it's IMPORTANT, like the lil glue that holds ur whole cohort situation together π«Ά we're in the Concurrency Kit zone here (that's libck, link it with -lck β¨)
πΈ SYNOPSIS πΈ
#include <ck_cohort.h>
CK_COHORT_INSTANCE(COHORT_NAME cohort_name);
π¦ DESCRIPTION π¦
so here's the tea, bestie β β after you've defined a cohort type, you can't just... use it. no ma'am. you gotta declare instances of it first, and CK_COHORT_INSTANCE is literally the macro that does that for you. periodt π
like, say you already used the CK_COHORT_PROTOTYPE macro to define a cohort type named foo. to make an actual instance of that type, you'd do:
CK_COHORT_INSTANCE(foo) cohort;
β¨ iconic. and guess what β you also use this same macro when you're allocating memory for cohorts, so it's giving two-jobs-one-macro energy π
like if you wanted to allocate a block of 4 cohorts, it'd look like:
CK_COHORT_INSTANCE(foo) *cohorts = malloc(4 *
sizeof(CK_COHORT_INSTANCE(foo)));
fr fr, use the macro inside sizeof too β don't try to be clever and hand-roll the type name, bestie, that's not the vibe π
π SEE ALSO π
go read these next, you're gonna be obsessed:
ck_cohort(3)CK_COHORT_PROTOTYPE(3)CK_COHORT_TRYLOCK_PROTOTYPE(3)CK_COHORT_INSTANCE(3)CK_COHORT_INITIALIZER(3)CK_COHORT_LOCK(3)CK_COHORT_UNLOCK(3)CK_COHORT_LOCKED(3)CK_COHORT_TRYLOCK(3)
and there's more lore at http://concurrencykit.org/ π
okay that's the whole page, no cap. this is the Concurrency Kit version, so like, go read the other ones too, they're all linked above π and this was dated February 24, 2013. β yes it's an old queen but she still slays π stay safe out there, bestie, and remember: declare ur instances before u use em, mwah ππ
π¦ 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