This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: terminate handler global or per thread?
- From: Ian Lance Taylor <iant at google dot com>
- To: harrold dot family at gmail dot com
- Cc: Brendan Miller <catphive at catphive dot net>, libstdc++ at gcc dot gnu dot org
- Date: Fri, 21 Aug 2009 15:25:50 -0700
- Subject: Re: terminate handler global or per thread?
- References: <ef38762f0908211420h6ec72f70y9207a07b58a9a608@mail.gmail.com> <m3hbw026vb.fsf@google.com> <c8f476a30908211519q5d071711y84b1a1a115b548b2@mail.gmail.com>
Mike Harrold <harrold.family@gmail.com> writes:
> On Fri, Aug 21, 2009 at 5:29 PM, Ian Lance Taylor <iant@google.com> wrote:
>
>> Brendan Miller <catphive@catphive.net> writes:
>>
>> > Is the terminate handler normal static data or is it thread local? I'm
>> > using GCC 3.4 and also 4.3.
>>
>> The terminate handler is a normal global variable. It is not thread
>> local.
>>
>> Ian
>>
>
> Doesn't this introduce all kinds of issues regarding thread safety?!?
If you want to have different terminate handlers in different threads,
then, yes, it certainly does. But that seems like a fairly unusual use
case to me.
Ian