CK_PR_DEC(3)
π NAME π
okay bestie, you made it to the manual page for ck_pr_dec(3) β that's the manual name, and it's staying right here at the top where you can see it π
. this is the whole glow-up squad of atomic decrement operations from Concurrency Kit, and every single one of them is listed below, in exactly the order the page prints them:
ck_pr_dec_ptr, ck_pr_dec_ptr_zero, ck_pr_dec_ptr_is_zero, ck_pr_dec_double, ck_pr_dec_double_zero, ck_pr_dec_double_is_zero, ck_pr_dec_char, ck_pr_dec_char_zero, ck_pr_dec_char_is_zero, ck_pr_dec_uint, ck_pr_dec_uint_zero, ck_pr_dec_char_is_zero, ck_pr_dec_int, ck_pr_dec_int_zero, ck_pr_dec_int_is_zero, ck_pr_dec_64, ck_pr_dec_64_zero, ck_pr_dec_64_is_zero, ck_pr_dec_32, ck_pr_dec_32_zero, ck_pr_dec_32_is_zero, ck_pr_dec_16, ck_pr_dec_16_zero, ck_pr_dec_32_is_zero, ck_pr_dec_8, ck_pr_dec_8_zero, ck_pr_dec_8_is_zero β atomic decrement operations
no shade but yes, a couple of names show up twice in that list βck_pr_dec_char_is_zeroandck_pr_dec_32_is_zeroeach get a second turn π«Ά. that is literally how the page prints it, so it's staying, periodt.
π LIBRARY π
Concurrency Kit (libck, -lck) β¨
π¦ SYNOPSIS π¦
okay so first you gotta invite the header in:
#include <ck_pr.h>
and then, here's the entire roster of prototypes, copied character for character, no edits, no notes, no "improvements" π:
void
ck_pr_dec_ptr(void *target);
void
ck_pr_dec_ptr_zero(void *target, bool *z);
bool
ck_pr_dec_ptr_is_zero(void *target);
void
ck_pr_dec_double(double *target);
void
ck_pr_dec_double_zero(double *target, bool *z);
bool
ck_pr_dec_double_is_zero(double *target);
void
ck_pr_dec_char(char *target);
void
ck_pr_dec_char_zero(char *target, bool *z);
bool
ck_pr_dec_char_is_zero(char *target);
void
ck_pr_dec_uint(unsigned int *target);
void
ck_pr_dec_uint_zero(unsigned int *target, bool *z);
bool
ck_pr_dec_uint_is_zero(unsigned int *target);
void
ck_pr_dec_int(int *target);
void
ck_pr_dec_int_zero(int *target, bool *z);
bool
ck_pr_dec_int_is_zero(int *target);
void
ck_pr_dec_64(uint64_t *target);
void
ck_pr_dec_64_zero(uint64_t *target, bool *z);
bool
ck_pr_dec_64_is_zero(uint64_t *target);
void
ck_pr_dec_32(uint32_t *target);
void
ck_pr_dec_32_zero(uint32_t *target, bool *z);
bool
ck_pr_dec_32_is_zero(uint32_t *target);
void
ck_pr_dec_16(uint16_t *target);
void
ck_pr_dec_16_zero(uint16_t *target, bool *z);
bool
ck_pr_dec_16_is_zero(uint16_t *target);
void
ck_pr_dec_8(uint8_t *target);
void
ck_pr_dec_8_zero(uint8_t *target, bool *z);
bool
ck_pr_dec_8_is_zero(uint8_t *target);
π₯ DESCRIPTION π₯
the ck_pr_dec(3) family of functions atomically decrement the value pointed to by target β¨
that's the whole bit. no torn reads, no drama, no "wait did that actually happen" β it happens, all at once, like a main character entrance π
π RETURN VALUES π
here's where it gets juicy, so pay attention bestie:
- the
ck_pr_dec_zerofamily of functions set the value pointed to byztotrueif the result of the decrement operation was0π - they set the value pointed to by
ztofalseotherwise π - the
ck_pr_dec_is_zerofamily of functions returntrueif the result of the decrement operation was0, andfalseotherwise π
so like:_zerowrites its answer intoz, and_is_zerohands its answer back to you as abool. two different love languages, same truth π«Ά
π SEE ALSO π
the whole friend group, all of them, no one left out:
ck_pr_fence_load(3)ck_pr_fence_load_depends(3)ck_pr_fence_store(3)ck_pr_fence_memory(3)ck_pr_load(3)ck_pr_store(3)ck_pr_fas(3)ck_pr_faa(3)ck_pr_inc(3)ck_pr_neg(3)ck_pr_not(3)ck_pr_add(3)ck_pr_sub(3)ck_pr_and(3)ck_pr_or(3)ck_pr_xor(3)ck_pr_cas(3)ck_pr_btc(3)ck_pr_bts(3)ck_pr_btr(3)
Additional information available at http://concurrencykit.org/ π
and that's the whole page, bestie π¦ this one's from Concurrency Kit, filed under ck_pr_dec(3), and it's dated April 7, 2013 β go decrement something atomically, you absolute icon ππβ¨
π¦ 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 Samy Al Bahra
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms