CK_COHORT_LOCK(3)
π CK_COHORT_LOCK(3) β bestie, it's time to grab the cohort lock π
okay so real talk, this page is from the Concurrency Kit manual, and yeah, it lives in section 3 of the manual. grab a snack, we're learning locks π
β¨ LIBRARY β¨
Concurrency Kit (that's libck, link it with -lck) π
πΈ SYNOPSIS πΈ
#include <ck_cohort.h>
CK_COHORT_LOCK(COHORT_NAME cohort_name, COHORT *cohort,
void *global_context, void *local_context);
like, that's the whole vibe. two contexts, one cohort, zero chill π
π DESCRIPTION π
So this call? It attempts to acquire both the local and global locks from cohort β global only if necessary, bestie, it's not out here doing extra work for no reason β¨
And because this is a locking call, it will block until both locks have been acquired. no cap. it just sits there, patiently, waiting for its moment. main character energy fr fr π«Ά
Now the contexts β here's the tea β:
global_contextgets passed as the second argument to the function that was provided as theglobal_lock_methodargument toCK_COHORT_PROTOTYPE, if that method is called. (emphasis on if, she's conditional π )local_contextgets passed to the function specified bylocal_lock_method.
that's it. that's the whole function. iconic behavior honestly π
β οΈ heads up bestie: this one blocks. if you can't handle the wait, that's literally what CK_COHORT_TRYLOCK(3) is for. iykyk π¦
π₯ SEE ALSO π₯
go read the whole family, they're all so good:
ck_cohort(3)CK_COHORT_PROTOTYPE(3)CK_COHORT_TRYLOCK_PROTOTYPE(3)CK_COHORT_INSTANCE(3)CK_COHORT_INITIALIZER(3)CK_COHORT_INIT(3)CK_COHORT_UNLOCK(3)CK_COHORT_LOCKED(3)CK_COHORT_TRYLOCK(3)
and if you want even more, there's always http://concurrencykit.org/ π β she's got everything, periodt.
mwah π that's a wrap, bestie β this page is dated February 24, 2013, it's the CK_COHORT_LOCK(3) page from the Concurrency Kit manual, and you absolutely ate this reading session. go forth and lock responsibly πβ¨π¦
π¦ 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