Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2008-05-28 15:02:28


Howard Hinnant:

> I've used this (for example) in implementing recursive mutexes:
>
> class recursive_mutex
> {
> unsigned state_;
> std::thread::id id_;

As already pointed out in the thread

http://www.decadentplace.org.uk/pipermail/cpp-threads/2006-August/001091.html

linked from #783, this requires thread::id atomicity, which is not
guaranteed. I'm not sure whether instant reuse can also break this
particular example, but it definitely breaks other uses of thread::id.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk