QB_THREAD_TRYLOCK(3)
π QB_THREAD_TRYLOCK β the libqb programmer's manual, section 3, bestie
okay so you're here for qb_thread_trylock, from the libqb Programmer's Manual, section 3 (yes the library functions section, we love her). she's a lil function that tries to grab a lock and, like, does not wait around for it. main character energy, zero patience. π«Ά
β¨ NAME β¨
qb_thread_trylock β calls either pthread_mutex_trylock() or pthread_spin_trylock().
that's it. that's the whole job. she's the "hey are you free? no? okay bye" of locking. π
πΈ SYNOPSIS πΈ
#include <qb/qbutil.h>
int32_t qb_thread_trylock(
qb_thread_lock_t *tl
);
so you pull in qb/qbutil.h, you hand her a pointer to a qb_thread_lock_t named tl, and she gives you back an int32_t. simple. clean. iconic. β¨
π¦ DESCRIPTION π¦
ngl, bestie, the original page leaves this section completely empty. like, nothing. not a single word. the DESCRIPTION is out here living its minimalist era and honestly? respect. π
so there is nothing documented here beyond what you already read in the NAME and SYNOPSIS β which is that she calls either pthread_mutex_trylock() or pthread_spin_trylock(). that's the whole documented vibe. i'm not gonna make stuff up about her, because that would be lying to you, and we don't do that here. π
fr fr: don't go assuming extra behaviour that this page doesn't state. if it's not written down, it's not written down. periodt.
π SEE ALSO π
the whole squad, go say hi:
qb_util_nano_current_get(3)qb_util_stopwatch_stop(3)qb_util_stopwatch_split(3)qb_util_stopwatch_split_ctl(3)qb_thread_unlock(3)qb_strerror_r(3)qb_util_stopwatch_time_split_get(3)qb_util_set_log_function(3)qb_util_timespec_from_epoch_get(3)qb_thread_lock_destroy(3)qb_util_nano_monotonic_hz(3)qb_util_nano_from_epoch_get(3)qb_util_stopwatch_create(3)qb_util_stopwatch_split_last(3)qb_thread_lock(3)qb_util_stopwatch_free(3)qb_thread_lock_create(3)qb_timespec_add_ms(3)qb_util_stopwatch_start(3)qb_util_stopwatch_us_elapsed_get(3)qb_util_stopwatch_sec_elapsed_get(3)
like, the entire friend group is in this list. go read them all, i'll wait. π
π COPYRIGHT π
Copyright (C) 2010-2020 Red Hat, Inc.
and that's the whole page, bestie π this libqb manual page (the LIBQB one, dated 2025-09-16) is officially read. now go trylock something. carefully. mwah. ππ
π¦ where this page comes from
- fedora 44: libqb-devel 2.0.9-2.fc44 Β· LGPL-2.1-or-later
- fedora 44: libqb-devel 2.0.9-2.fc44 Β· LGPL-2.1-or-later
- ubuntu resolute: libqb-dev 2.0.9-1ubuntu1 Β· LGPL-2.1-or-later
- ubuntu stonking: libqb-dev 2.0.9-1ubuntu1 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms