CK_COHORT_PROTOTYPE(3)
π CK_COHORT_PROTOTYPE β bestie's guide to defining a cohort type (3)
okay so like. you're in ck_cohort land. hi. welcome. π«Ά
π LIBRARY
Concurrency Kit (libck, -lck) β yes girl, link it.
β¨ SYNOPSIS β¨
#include <ck_cohort.h>
CK_COHORT_PROTOTYPE(COHORT_NAME cohort_name, TYPE global_lock_method,
LOCK_FXN global_unlock_method, LOCK_FXN local_lock_method,
LOCK_FXN local_unlock_method);
πΈ DESCRIPTION πΈ
here's the tea, bestie: ck_cohort.h ships with absolutely zero cohort types defined. not one. empty. the header is giving "i'm just a template, do it yourself" energy. π
so you β the main character β have to define whatever types you want using the CK_COHORT_PROTOTYPE or CK_COHORT_TRYLOCK_PROTOTYPE(3) macros. and heads up: if you want your cohort type to support trylock operations, you have to use CK_COHORT_TRYLOCK_PROTOTYPE. CK_COHORT_PROTOTYPE is not the one for that, no cap. π
the CK_COHORT_PROTOTYPE macro eats the following arguments:
cohort_nameβ an identifier for this cohort type. this is the name you'll be passing to literally every otherCK_COHORTmacro, so remember it. it's the moment, it's the brand, it's the whole identity. πglobal_lock_methodβ the method that should be called to acquire the global lock π₯global_unlock_methodβ the method that should be called to relinquish the global locklocal_lock_methodβ the method that should be called to acquire the local lock β¨local_unlock_methodβ the method that should be called to relinquish the local lock
and once you've defined your lil type? you declare instances of it like this:
CK_COHORT_INSTANCE(cohort_name) cohort;
look at you. iconic. defining types. slaying. π
π SEE ALSO
go read these next, bestie, they're all part of the saga:
ck_cohort(3)CK_COHORT_TRYLOCK_PROTOTYPE(3)CK_COHORT_INSTANCE(3)CK_COHORT_INITIALIZER(3)CK_COHORT_INIT(3)CK_COHORT_LOCK(3)CK_COHORT_UNLOCK(3)CK_COHORT_LOCKED(3)CK_COHORT_TRYLOCK(3)
additional information available at http://concurrencykit.org/ π
mwah π that's the whole page. courtesy of Concurrency Kit (libck, -lck), dated February 24, 2013 β yes it's an old queen but she still eats. go lock something (safely). periodt. π
β¨
π¦ 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