[PATCH] D20328: [libcxx] Externally threaded libc++ variant

Asiri Rathnayake via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 13 09:40:12 PDT 2016


rmaprath added a comment.

In http://reviews.llvm.org/D20328#456271, @mclow.lists wrote:

> >   I've adopted a initialize-on-first-use policy to workaround this particular problem.
>
>
> That's not constexpr.
>
> You say it in your comment "This prohibits any prospects of calling a runtime initialization routine", but then you have a runtime initialization routine.


`std::mutex()` constructor is still constexpr, what I've done is to defer the initialization to `lock()` and `unlock()` methods. This is pretty much the only way I can keep the constructor constexpr and allow an underlying platform implementation to provide the guts of `std::mutex`.

Hope that makes sense?


http://reviews.llvm.org/D20328





More information about the cfe-commits mailing list