On Fri, 12 Dec 2025 at 10:32, Peter Zijlstra <[email protected]> wrote: > On Thu, Dec 11, 2025 at 02:12:19PM +0100, Marco Elver wrote: > > > What's a better name? > > That must be the hardest question in programming; screw this P-vs-NP > debate :-) > > > context_lock_struct -> and call it "context lock" rather than "context > > guard"; it might work also for things like RCU, PREEMPT, BH, etc. that > > aren't normal "locks", but could claim they are "context locks". > > > > context_handle_struct -> "context handle" ... > > Both work for me I suppose, although I think I have a slight preference > to the former: 'context_lock_struct'. > > One other possibility is wrapping things like so: > > #define define_context_struct(name) ... // the big thing > > #define define_lock_struct(name) define_context_struct(name)
Note that 'context_lock_struct' (assuming that's the new name) can be used to just forward declare structs, too, so 'define' in the name is probably incorrect. And to avoid more levels of indirection I'd just stick with one name; if 'context_lock_struct' isn't too offensive to anyone, that'd be the name for the next version. Thanks, -- Marco
