
28 May
2008
28 May
'08
7:02 p.m.
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.htm... 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.