CK_BITMAP_BTS(3)
π CK_BITMAP_BTS(3) β the Concurrency Kit manual, bestie edition π
okay so. sit down. hydrate. we're talking about ck_bitmap_bts(3) from the Concurrency Kit, and honestly? she's a little icon. β¨
πΈ LIBRARY πΈ
Concurrency Kit β aka libck, and when you link her you use -lck. periodt.
β¨ SYNOPSIS β¨
#include <ck_bitmap.h>
bool
ck_bitmap_bts(ck_bitmap_t *bitmap, unsigned int n);
like. look at her. two args. one bool. no drama. π
π¦ DESCRIPTION π¦
ck_bitmap_bts() does the cutest little two-for-one: she sets the bit at the offset specified by the argument n to 1, and she fetches its original value on the way out. not me doing two jobs in one call, main character energy fr fr π
so you get the new state (the bit is 1 now, bestie, that's done) and the old state, which is genuinely so useful if you're trying to figure out whether you were the one who flipped it or whether somebody else got there first. iykyk. π₯
π RETURN VALUES π
This function returns the original value of the bit at offset n in bitmap.
read that again. the ORIGINAL value. not the new one. she already set it to1, but she's telling you what it was before she touched it. that's the whole point of thebtsand it's lowkey the most important sentence on this page. π
π SEE ALSO π
the whole bitmap friend group, all iconic, all worth a read:
ck_bitmap_base(3)ck_bitmap_size(3)ck_bitmap_init(3)ck_bitmap_reset(3)ck_bitmap_clear(3)ck_bitmap_set(3)ck_bitmap_test(3)ck_bitmap_bits(3)ck_bitmap_buffer(3)
Additional information available at http://concurrencykit.org/ π«Ά
k bye bestie, go set some bits πβ¨
mwah π β this page is from August 22, 2014, filed under CK_BITMAP_BTS(3), and that's on 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 2014 David Joseph
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms