I wrote a safe thread class that does automatic cleanup. I wrapped it as a .lib . So far I have only released the x86 version, but I will probably release the x64 version. The libraries for both Microsoft Visual Studio 6.0 and GCC are included.
Here's the link -
http://www.anthonyqbachler.com/CThread.rar