Boost logo

Boost :

Subject: Re: [boost] [thread] C++11 once_flag enabled when constexpr is not available
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2013-03-05 07:31:52


Le 22/02/13 23:49, Andrey Semashev a écrit :
> Hi, Vicente!
>
> I see you applied my patch for call_once but you seem to forgot to disable the
> C++11 call_once interface when the compiler does not support constexpr. Was
> that intentional or you just missed it?
>
> Anyway, please find the patch attached.
>
Hi Andrey,

In your patch you say

+// For C++11 call_once interface the compiler MUST support constexpr.
+// Otherwise once_flag would be initialized during dynamic
initialization stage, which is not thread-safe.

I'm not an expert on the C++11 wording. Could you elaborate why
once_flag would be initialized during dynamic initialization stage?

Thanks in advance,
Vicente


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