Re: [PATCH v5 06/36] cleanup: Basic compatibility with context analysis
From: Bart Van Assche
Date: Fri Dec 19 2025 - 14:16:39 EST
On 12/19/25 7:39 AM, Marco Elver wrote:
+#define DECLARE_LOCK_GUARD_1_ATTRS(_name, _lock, _unlock) \Elsewhere in the cleanup.h header arguments with the names "_lock" and
+static inline class_##_name##_t class_##_name##_constructor(lock_##_name##_t *_T) _lock;\
+static __always_inline void __class_##_name##_cleanup_ctx(class_##_name##_t **_T) \
+ __no_context_analysis _unlock { }
"_unlock" hold executable code that perform "lock" and "unlock"
operations respectively, e.g. mutex_lock() and mutex_unlock(). The
DECLARE_LOCK_GUARD_1_ATTRS() "_lock" and "_unlock" arguments however are
function annotations. Please prevent confusion and use other names for
the _lock and _unlock arguments, e.g. _acquire_attr and _release_attr.
Thanks,
Bart.