closure_retu...h_destructor(9)
π« closure_return_with_destructor(9) π«
okay so this is a page straight out of the Kernel API Manual bestie, and we're talking about a closure finisher with a lil cleanup era attached. stay with me π«Ά
β¨ NAME β¨
closure_return_with_destructor β finish execution of a closure, with destructor π
πΈ SYNOPSIS πΈ
closure_return_with_destructor (_cl , _destructor );
π ARGUMENTS π
_clβ ngl the original literally just says-- undescribed --π so that's all we got, no cap_destructorβ also-- undescribed --π the docs said "not today" and honestly? iconic of them
π¦ DESCRIPTION π¦
So it works exactly like closure_return β¨ β same vibe, same job β except that destructor gets called when all outstanding refs on cl have been dropped. π«Ά
What's the destructor even for? It may be used to safely free the memory occupied by cl π§ and here's the part that matters, so lock in π
destructoris called with the ref on the parent closure still held β sodestructorcould safely return an item to a freelist protected bycl's parent. π
like, the parent ref is still yours when the destructor runs, that's the whole point, don't sleep on it π€
π SEE ALSO π
Kernel file ./include/linux/closure.h β
closure_sync(9)closure_get(9)closure_get_not_zero(9)closure_init(9)closure_wake_up(9)continue_at(9)closure_return(9)continue_at_nobarrier(9)closure_call(9)
go read them, they're all fr fr part of the same closure cinematic universe π
mwah π this page lives in ./include/linux, dated October 2026, and it's titled closure_retu...h_destructor(9) β yes the title is truncated with the lil ... and yes we're keeping it exactly like that, slay πβ¨
π¦ 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