读书人

有关线程的有关问题

发布时间: 2012-02-14 19:19:19 作者: rapoo

有关线程的问题
创建一个线程CreateThread,那怎么知道该线程何时结束呢?

[解决办法]
一、你要等待线程结束,使用WaitSingleObject()
二、你只是想知道线程结束的时间,让线程结的时候做些记号就是了。

[解决办法]
When a thread terminates, the thread object attains a signaled state, satisfying any threads that were waiting on the object.

The thread object remains in the system until the thread has terminated and all handles to it have been closed through a call to CloseHandle.

读书人网 >C语言

热点推荐