Details
Details
- Reviewers
kib markj - Group Reviewers
Src Committers
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped - Build Status
Buildable 76578 Build 73461: arc lint + arc unit
Event Timeline
Comment Actions
My reading of the documentation says it is not.
It will allow to pass pointer to any structure that starts with struct lock_object with calling conventions of struct lock_object.
Comment Actions
But then you access it through the first member which is the pointer to lock_object. I believe that this still breaks the C aliasing rules.
More, I do not see why trying to use this ugly gcc extension. There is C-standard _Generic() facility, which allows to enumerate allowed types for an expression and do something specific to deduced type.
I suspect that uglyness predated C11.
And, I do not understand why you don't do simply
#define callout_init_mtx(c, mtx, flags) callout_init_lock((c), &(mtx)->lock_object, (flags))
and same for all other blocking locks.