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.