qlfqueue_enqueue(3)

πŸ“¦ version 1.22^20251007gitcedb1fc, in fedora 43, fedora 44

πŸ’– qlfqueue_enqueue β€” bestie, it's time to yeet an element into the queue πŸ’–

okay so real quick before we dive in: this page lives in the libqthread manual, section 3, and it's literally called qlfqueue_enqueue. it's giving lock-free queue core behavior and honestly? iconic. let's get into it ✨


✨ NAME ✨

qlfqueue_enqueue β€” append an element to a lock-free queue 🫢


🌸 SYNOPSIS 🌸

first things first, you gotta pull in the header, no cap:

#include <qthread/qlfqueue.h>

and here's the function signature, character for character, don't come for me:

int
qlfqueue_enqueue (qlfqueue_t *q, void *elem);

πŸ¦‹ DESCRIPTION πŸ¦‹

so like, this function appends elements to lock-free queues. that's the whole vibe. you hand it a queue and an element, and it puts that element at the back. main character energy for your data structure fr fr πŸ’…


⭐ RETURN VALUE ⭐

the return value is gonna be 0 if everything slayed, or it'll indicate an error. so if you see 0, we're so back. if not… vibe check failed, bestie 😭


πŸŽ€ ERROR CODES πŸŽ€

possible error codes, listen up:

  • QTHREAD_BADARGS β€” this one means one of the input arguments was null. literally the "you forgot to pass me something, bestie" error πŸ™ˆ

🌈 SEE ALSO 🌈

go read these next, iykyk:


lowkey the cutest thing about this whole page? it lists itself in SEE ALSO. self-love, periodt. πŸ‘‘

okay that's the whole page, no notes πŸ’œ this came from libqthread, dated APRIL 2011, and that's your sign-off bestie β€” go enqueue something legendary 🧚✨

πŸ“¦ where this page comes from