CloseHandle invalidates the specified object handle, decrements the object's handle count, and performs object retention checks. After the last handle to an object is closed, the object is removed from the system. Closing a thread handle does not terminate the associated thread. To remove a thread object, you must terminate the thread, then close all handles to the thread.

解决方案 »

  1.   

    CloseHandle只是减少线程内核对象的计数,但是线程函数并没有被终止,而是由系统接管线程。什么时候关闭好像没有什么一定的情况,主要是看你是否还使用线程句柄了。
      

  2.   

    也不定什么创建线程之后就要调用CloseHandle,如果这个句柄留给还有用的话,比如说要在其它地方调用某个函数,要用到这个句柄,那么就可以到要结束线程之前CloseHandle。