[clang] Support [[guarded_by(mutex)]] attribute inside C struct (PR #94216)

Pierre d'Herbemont via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 5 07:44:07 PDT 2024


pdherbemont wrote:

> > > > One question I have is whether there will be follow-up work for other thread safety attributes (`acquire_capability`, `try_acquire_capability`, etc)?
> > > 
> > > 
> > > They already work fine in C so far. But if you are aware of some issues don't hesitate to let me know!
> > 
> > 
> > Ah, sorry, of course I picked examples that appertain to functions rather than fields. But some of the other thread safety attributes have the same problem as `guarded_by`: https://godbolt.org/z/hWTMxzrns
> 
> Oh yes – maybe it makes sense to fix them in this commit. Let me try to look into that quickly.

Seems like it's an easy change for `acquired_after` and `acquired_before`! Added support & a test.

https://github.com/llvm/llvm-project/pull/94216


More information about the cfe-commits mailing list