question about __cxa_guard_acquire and static variables in the scope of a function

Ian Lance Taylor iant@google.com
Mon May 9 23:36:00 GMT 2011


Brendan Miller <catphive@catphive.net> writes:

> In G++ 4.1.2 one of my coworkers thinks he's seeing a case where the
> second time __cxa_guard_acquire is called, it does not block, but just
> throws an exception. Could someone please clarifies whether this is
> the expected behavior?

No, but it's perhaps worth noting that this code has been rewritten
since 4.1.2.  The 4.1.2 code was buggy when the initializer of a static
variable started a new thread which in turn tried to initialize the
static variable itself.

Ian



More information about the Libstdc++ mailing list