Re: No way to cleanup at thread exit for __thread variables?

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

 



Ian Lance Taylor wrote:

> You may be able to use pthread_cleanup_push within the thread function
> itself--the function you pass to pthread_create.

Yeah, I considered that. Unfortunately the thread function could choose
to call various APIs in the application core that may or may not use a
bunch of other thread local variables, so the thread function itself
wouldn't have knowledge of the existence of these variables.

> __thread variables can point to dynamically allocated storage.  But
> you are correct that there is no direct analog to the cleanup function
> used by pthread_key_create.

I think we'll stay right where we are then :-) Thanks for the input.

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux