
Anthony Williams:
If not so, what's the reason for boost::detail::lightweight_mutex to exist ?
I think it's a historic artifact from versions of boost.thread prior to 1.35.0 when boost::mutex required linking to the thread library, which allowed mutexes to be used in header-only boost libraries.
True. "lightweight" was an unfortunate name; it's only lightweight in that it doesn't require a library build step. It's in the detail:: namespace, so this should be enough of a hint that it's only an implementation detail of other Boost libraries and is not meant to be used directly.
I'll leave it to Peter to comment on whether he thinks it's still required and why.
I just tried a simple #include