update_queue(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 NAME 🌸

Okay so this is update_queue(9), straight out of the Kernel API Manual, and it is literally the function that looks for tasks that can be completed. Bestie, that is the whole name vibe. πŸ’–

✨ SYNOPSIS ✨

int update_queue (struct sem_array *sma , int semnum , struct
       wake_q_head *wake_q );

πŸŽ€ ARGUMENTS πŸŽ€

  • sma β€” a semaphore array. Yep, the whole array. 🫢
  • semnum β€” the semaphore that was modified. This little number matters. πŸ‘‘
  • wake_q β€” the lockless wake-queue head. Iconic lockless energy, no cap. πŸ’…

πŸ’… DESCRIPTION πŸ’…

update_queue must be called after a semaphore in a semaphore array was modified. Like, that is the rule, bestie β€” do not skip it. ⭐

If multiple semaphores were modified, update_queue must be called with semnum = -1, as well as with the number of each modified semaphore. So yes, -1 and every modified semaphore’s number get their moment. 🌈

The tasks that must be woken up are added to wake_q. The return code is stored in q->pid. The function internally checks if const operations can now succeed. πŸ”₯

The function returns 1 if at least one semop was completed successfully. That is the success signal, periodt. πŸ’€βœ¨

πŸ”₯ SEE ALSO πŸ”₯

Lowkey go check the Kernel file ./ipc/sem.c, plus these absolute icons: unmerge_queues(9), merge_queues(9), newary(9), wake_const_ops(9), do_smart_wakeup_zero(9), set_semotime(9), do_smart_update(9), and find_alloc_undo(9). πŸ¦‹


Signed off from ./ipc, dated October 2026 β€” source/date vibe secured, and yes, this is the update_queue(9) manual page. Mwah. πŸ’‹πŸ’œ

πŸ“¦ where this page comes from