Is there some way to have more control over how thread_local objects are destroyed upon thread exit? When using the old posix pthread_key_create for TLS storage, one was able to specify a destructor callback and do whatever you want. I cant seem to find the equivalent for the new c++11 thread_local. My issue is that I need to potentially delay destruction of the thread local data, as is may be pending use in another thread. I would be able to do this using pthread_key_create. After some extensive googling I did find __cxa_thread_atexit as a potential answer here, but couldn't find any good documentation on it and its unclear how to actually use it
Aucun commentaire:
Enregistrer un commentaire