QB_THREAD_LOCK_CREATE(3)
π QB_THREAD_LOCK_CREATE β bestie edition
okay so this page is QB_THREAD_LOCK_CREATE(3) from the libqb Programmer's Manual, and we're gonna make a lock. a whole new lock. of a type you pick. let's go π
β¨ NAME β¨
qb_thread_lock_create β Create a new lock of the given type.
like that's literally it. that's the whole job. she creates locks π
πΈ SYNOPSIS πΈ
#include <qb/qbutil.h>
qb_thread_lock_t * qb_thread_lock_create(
/*
* QB_THREAD_LOCK_SHORT == spinlock (where available, else mutex)
* QB_THREAD_LOCK_LONG == mutex
*/
qb_thread_lock_type_t type
);
no cap, that's the whole call. you hand her a type and she hands you back a lock. periodt β¨
π¦ PARAMS π¦
typeβ the vibe of lock you want, bestie:QB_THREAD_LOCK_SHORT== spinlock (where available, else mutex)QB_THREAD_LOCK_LONG== mutex
so short = spinny if your system's got it, otherwise she just falls back to a mutex, no drama. long = mutex, always, every time π
π DESCRIPTION π
hmm okay so this section is literally just here being a heading, there's no prose under it in the original. iconic of her honestly, she said "the title speaks for itself" π
the tea is: you call qb_thread_lock_create, you tell her which type you want from the params up there, and she spins you up a fresh lock. that's the whole storyline. main character energy only π
π STRUCTURES π
the enum you're pulling type from, in all her glory:
enum qb_thread_lock_type_t {
QB_THREAD_LOCK_SHORT;
QB_THREAD_LOCK_LONG;
};
two options. two moods. pick your fighter β
π RETURN VALUE π
pointer to qb_thread_lock_type_t or NULL on error.
π«Ά bestie if you get NULL back, something went sideways β that's your sign to check yourself before you wreck yourself. do NOT go dereferencing that. no cap π
π₯ SEE ALSO π₯
the whole friend group, all of them, every single one, we don't leave anybody out:
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_thread_trylock(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_timespec_add_ms(3), qb_util_stopwatch_start(3), qb_util_stopwatch_us_elapsed_get(3), qb_util_stopwatch_sec_elapsed_get(3)
go read them. or don't. i'm not your mom, i'm just your bestie who knows things π§
π COPYRIGHT π
Copyright (C) 2010-2020 Red Hat, Inc.
and that's the page babes π big kisses from the libqb girlies β this one's dated 2025-09-16, so it's fresh, it's cute, it's giving documentation π bye bestie, go lock something π¦β¨
π¦ 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
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms