bug-guile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gc] Calling ‘GC_pthread_create ’ from a pthread key destructor


From: Ludovic Courtès
Subject: Re: [Gc] Calling ‘GC_pthread_create ’ from a pthread key destructor
Date: Sun, 24 Apr 2011 15:04:55 +0200
User-agent: Gnus/5.110015 (No Gnus v0.15) Emacs/23.3 (gnu/linux)

Hi,

Ivan Maidanski <address@hidden> writes:

>> pthread_setspecific (key, GC_STRDUP ("hello, world"));
>
> Just one note. Are you aware that this code is equivalent (since TLS is not 
> traced by GC) to:
>
> (void)GC_STRDUP ("hello, world");
> pthread_setspecific (key, <some_number>);

Yes.  The only point of this statement is to stress the GC and associate
an initial value with the key (otherwise its destructor is never
called.)

Thanks,
Ludo’.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]