STRUCT BINDER_THREAD(9)
π struct binder_thread(9) β binder thread bookkeeping π
hey bestie π«Ά welcome to the Kernel API Manual page for struct binder_thread(9). this is literally the bookkeeping arc for binder threads, and it's lowkey iconic how much tiny state lives in this one struct π
πΈ NAME πΈ
struct binder_thread β binder thread bookkeeping. that's the whole vibe: binder's per-thread little admin nest β¨
π SYNOPSIS π
struct binder_thread {
struct binder_proc *proc;
struct rb_node rb_node;
struct list_head waiting_thread_node;
int pid;
int looper;
bool looper_need_return;
struct binder_transaction *transaction_stack;
struct list_head todo;
bool process_todo;
struct binder_error return_error;
struct binder_error reply_error;
struct binder_extended_error ee;
wait_queue_head_t wait;
struct binder_stats stats;
atomic_t tmp_ref;
bool is_dead;
};
π¦ Members π¦
procβ the binder process this thread belongs to. it's invariant after initialization, so once it's set, it stays set β no cap π«Άrb_nodeβ the element for theproc->threadsrbtree. protected byproc->inner_lock, so respect the lock bestie πwaiting_thread_nodeβ element for theproc->waiting_threadslist. also protected byproc->inner_lockβ¨pidβ the PID for this thread. invariant after initialization, meaning it's not out here changing its whole personality πlooperβ bitmap of looping state. only accessed by this thread, so it's giving "no sharing, no drama" energy π¦transaction_stackβ stack of in-progress transactions for this thread. protected byproc->inner_lockπ₯todoβ list of work to do for this thread. protected byproc->inner_lockπprocess_todoβ whether work intodoshould be processed. protected byproc->inner_lockβreturn_errorβ transaction errors reported by this thread. only accessed by this thread β personal error journal vibes πreply_errorβ transaction errors reported by the target thread. protected byproc->inner_lockπeeβ extended error information from this thread. protected byproc->inner_lockπwaitβ wait queue for thread work. the thread waits here for work, cute πstatsβ per-thread statistics. they're atomics, so no lock needed πtmp_refβ temporary reference to indicate the thread is in use. it's atomic sinceproc->inner_lockcannot always be acquired β this is a real caveat, not just lore bestie β οΈis_deadβ thread is dead and awaiting free when outstanding transactions are cleaned up. protected byproc->inner_lockπ
tiny note bestie: looper_need_return shows up in the struct up top, but this page doesn't give it a separate member blurb, so i'm not making one up π
π Description π
okay so this is the bookkeeping structure for binder threads. that's it, that's the tea β it's the struct that keeps binder threads' bookkeeping together, and this page is the field-by-field tour β¨π
β SEE ALSO β
bestie, go peek at these:
- Kernel file
./drivers/android/binder_internal.h struct binder_device(9)struct binder_work(9)struct binder_node(9)struct binder_ref_data(9)struct binder_ref(9)struct binder_proc(9)struct binder_txn_fd_fixup(9)struct binder_object(9)
k that's the page π«Ά source/version: ./drivers/android Β· date: October 2026 Β· page: struct binder_thread(9) β slay and stay bookkept β¨π
π¦ 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