Re: [basic-improvements] Remove __gthread_key_dtor
Zack Weinberg <zack <at> codesourcery.com>
2002-11-01 00:12:23 GMT
On Thu, Oct 31, 2002 at 02:31:21PM -0800, Eric Christopher wrote:
> re mutexes: Sony only has mutexes and not a real thread system at all.
> So, we get to "invent" things via locking and mutexes.
Understood. In fact, looking over your code, I just wrote some very
similar stuff for VxWorks (which has threads, but neither once_t nor
thread-specific data as POSIX defines it).
> Now, I may have a problem with my implementation based on rth's email,
> but here's the dtor function as it currently exists:
> static inline int
> __gthread_key_dtor (__gthread_key_t key, void *ptr)
> /* Just reset the key value to zero. */
> if (ptr)
> return __gthread_setspecific (key, 0);
> return 0;
This implementation is identical with several of the ones I calmly
wiped out of existence as "does nothing useful". The thread
destruction logic is (should be) responsible for doing this.
I see a number of problems with your fake TSD implementation, but
nothing that requires you to have a __gthread_key_dtor routine. See