Re: [PATCH RFC 00/33] Compile-time thread-safety checking
From: Marco Elver
Date: Fri Feb 07 2025 - 04:43:12 EST
On Fri, 7 Feb 2025 at 10:08, Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
>
> On Fri, Feb 07, 2025 at 10:05:47AM +0100, Marco Elver wrote:
>
> > Yes, you can add multiple guarded_by. But it's just going to enforce
> > that you need to hold both locks before you access the member. If you
> > want the rules to be more complex, the best way to express that is with
> > some helpers. E.g. something like this (tested on top my series)
>
> Oh gawd, this is going to be a pain, isn't it :/
For complex locking patterns, yes. :-/
Which is why I'm proposing it to be opt-in but relatively complete
(most primitives supported), so that either we have time to work out
how to deal with more complex patterns, or just leave some things
opted-out.