Hi,

I am using boost::thread for a plug-in that is loaded by a third-party Linux application. I have no control over the host's threading or when it chooses to unload my code.

Unfortunately I experience a crash every time the host thread unloads the .so and terminates. I get the following backtrace:

(gdb) bt
#0  0x00007fffde12c460 in ?? ()
#1  0x00000032cf607889 in start_thread () from /lib64/libpthread.so.0
#2  0x00000032cf2e5ccd in clone () from /lib64/libc.so.6

Not much to go on...

I am pretty confident the crash is happening in a pthread key destructor registered by Boost. The only parts of the boost::thread library I am currently using are the synchronization classes:

shared_mutex,
shared_lock,
unique_lock,
upgrade_lock,
upgrade_to_unique_lock

I'm not directly using any thread-specific storage myself.

What I would like to do is force boost to call its TSS destructor in my plug-in's destroy_dso() function. Is this at all possible?

Many thanks,

- Andrew