llist_del_first(9)
β¨ llist_del_first β¨
okay so this is from the Kernel API Manual, section 9 β yes the whole (9) thing, that's the section bestie, we love a numbered era π
π NAME π
llist_del_first β delete the first entry of a lock-less list. that's it. that's the whole vibe. π¦
πΈ SYNOPSIS πΈ
struct llist_node * llist_del_first (struct llist_head *head );
literally the whole signature, no notes π
π ARGUMENTS π
headβ the head for your lock-less list π«Ά like, the actual entry point of the whole thing, you gotta hand it over
π DESCRIPTION π
okay so first things first: vibe check on the list. if the list is empty, you get NULL back. that's the deal. no list, no entry, no nothing π
otherwise? you get the first entry back β deleted, babes, it's gone from the list and it's yours now. and here's the fun part: that entry is the newest added one. newest in, first out. it's giving stack energy honestly π
now the big caveat, and I need you to actually read this one because it's the whole reason this page exists π
Only onellist_del_firstuser can be used simultaneously with multiplellist_addusers β and that's without a lock. if you want more consumers than that, nope, not happening, not today bestie.
why? because otherwise, the sequence llist_del_first, llist_add, llist_add in another user may change head->first->next, but keep head->first. yeah. it'll mess with the links and leave the head pointing at the same place, and that is a whole situation π (same energy applies to llist_del_all, llist_add, llist_add in another user β that sequence has the same problem, so don't come for me saying I didn't warn you)
so if you genuinely need multiple consumers? you've got two options, pick your fighter:
- use
llist_del_allπ - or put a lock between your consumers π
no third option, no secret hack, that's the menu π
π§ SEE ALSO π§
- Kernel file
./lib/llist.c llist_del_first_this(9)llist_reverse_order(9)
and that's the page!! mwah π this one came from ./lib and it's dated October 2026 β so yeah, mark your calendars, screenshot it, put it in the group chat, the llist lore is timeless fr fr πβπ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms