On 2011-05-17 Thorsten Glaser wrote: > Lasse Collin dixit: > >To be more exact, I meant a function that would return a pointer to > >thread-specific char array. POSIX has pthread_key_create() and > > Oh sure. Let’s just force all xz users to link in libpthread…
It already does that unless you pass --disable-threads to configure when compiling XZ Utils. 5.1.1alpha does threaded compression, so most people don't want to disable threading support. It's the dlopen/dlclose situation that worries me. GNU and Solaris call functions registered with atexit() when a library is unloaded, but that trick isn't supported e.g. on BSDs. GCC's __attribute__((destructor)) seems to work on a few other systems too, but it requires that the compiler supports GNU C extensions, which isn't an acceptable requirement in this case. -- Lasse Collin | IRC: Larhzu @ IRCnet & Freenode