[cfe-dev] Thread safety annotations for movable lock guards

Delesley Hutchins delesley at google.com
Tue May 6 10:51:05 PDT 2014


We currently have two analyses in clang.  Thread safety analysis knows
about locks, and consumed analysis knows about movable types, like
unique_ptr.  Unfortunately, they don't talk to each other right now.
:-(  There are plans to combine the two, but we're probably looking at
an end-of-year time frame.

  -DeLesley


On Tue, May 6, 2014 at 10:30 AM, Stephan Tolksdorf <st at quanttec.com> wrote:
> Hi,
>
> Is there a way to make clang's thread safety annotations work with movable
> lock guards (i.e. RAII classes for locking a mutex), like e.g.
> std::unique_lock? How should the move constructor of such a lock guard be
> annotated, or a factory function returning a guard?
>
> If this is currently not supported, are there maybe any plans to support it
> in the future?
>
> Thanks in advance for any hint!
>
> Best regards,
>   Stephan



-- 
DeLesley Hutchins | Software Engineer | delesley at google.com | 505-206-0315



More information about the cfe-dev mailing list