In the unix world using pthreads, when you allocate thread-local storage, you specify a callback function to delete the storage when the thread terminates. This callback is the second argument to pthread_key_create(), See, for example,
http://www.mkssoftware.com/docs/man3/pthread_key_create.3.asp Question: How do you do the same thing on windows? How do you get a thread to clean up its thread-local-storage obtained using TlsAlloc() and TlsSetValue() when the thread terminates? I need an answer to this question so that I can fix ticket #1601: http://www.sqlite.org/cvstrac/tktview?tn=1601 -- D. Richard Hipp <[EMAIL PROTECTED]>