Re: [PATCH tip/locking/core] compiler-context-analysis: Support immediate acquisition after initialization

From: Bart Van Assche

Date: Thu Jan 15 2026 - 13:04:48 EST


On 1/15/26 10:58 AM, Marco Elver wrote:
A corollary of this would be "If tooling can't handle a simple pattern
of initializing a lock and guarded members, that's a hard show
stopper".

That's your opinion. I'm not sure anyone else shares this opinion.

If an __assume_ctx_lock() annotation is missing from initialization
code, that will result in a clear and easy to fix error message.

Silently ignoring two classes of real bugs is a much worse choice in my
opinion than requesting __guarded_by() users to add an
__assume_ctx_lock() annotation in initialization code.

Bart.