Boost logo

Boost :

Subject: Re: [boost] [thread] boost::thread and thread safety annotations
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2013-03-04 17:09:25

Le 26/09/12 11:33, Wladimir a écrit :
> Hello,
> The Clang C++ compiler project is currently working on a thread safety
> analyzer.
> By making use of so-called thread safety annotations within the source
> code, several problems with synchronization primitives can be found
> statically. For example: usage of a data structure without acquiring its
> guarding lock.
> See here for an overview of the available attributes:
> It is customary to use these attributes by defining macros, for
> compatibility:
> At one time, it was also supposed to end up in G++, but this was
> abandoned in favor of clang (see
> But at least the
> annotations are fairly standardized.
> I think it would be useful to add these annotations to boost::thread, so
> that projects using that library can make use of the static checking.
> As I understand it, is only a matter of marking data structures that
> serve as lock/scoped_lock (such as boost::mutex, boost::recursive_mutex,
> ...), and methods that act upon the lock with the appropriate attributes.
> Any interest in this?

yes why not. Do you have some examples where these annotations could be
used on BoostThread?


Boost list run by bdawes at, gregod at, cpdaniel at, john at