CloseHandle关闭句柄并没有终止新创建的线程。只是表示对新创建的线程的引用不敢兴趣,系统会递减新 线程的线程内核对象的使用计数。当使用计数为0的时候,系统就会释放线程内核对象。如果在主线程中没有关闭线程的句柄,始终都会保留一个引用。这样线程内核对象的引用计数就不会 为0。即使新线程执行完毕,线程内核对象也不会被释放,只有等到进程终止的时候系统才会为 残留的对象做清理工作。所以应该在不再使用线程的句柄的时候将其关闭掉,让线程的线程内核对象的引用计数减1
Closing a thread handle does not terminate the associated thread. To remove a thread object, you must terminate the thread, and then close all handles to the thread.
MSDN上的一句话!