17 Jul
2006
17 Jul
'06
10:40 a.m.
Peter Dimov wrote:
TLS indices are per-process, and since the TLS index used by the cleanup code cannot be cleaned before process exit, it doesn't matter whether there is an explicit TlsFree. When the process dies, so will all its TLS indices.
I could have put a TlsFree in on_process_exit, but it's better not to. If on_process_exit is (for some reason) called before all on_thread_exits, the cleanup handlers won't have a chance to execute and will leak.
Thank you very much for your careful explanation, Peter! Given the advantages of *more* simplicity and *less* warnings by often-used tools, wouldn't it be appropriate to use this code as actual implementation of Boost.Thread? Greetings from Bremen, Daniel