Accor开发者_高级运维ding to this webpage:
To safely use CWinThread, you must start the thread suspended and set the CWinThread object's m_bAutoDelete member to false or DuplicateHandle a copy of its m_hThread member
Does this mean that the AfxBeginThread function is unsafe to use as well?
The documentation you linked seems pretty clear - you can set the CREATE_SUSPENDED
flag in the call to AfxBeginThread
and set the m_bAutoDelete
member before calling CWinThread::ResumeThread
, along with any other required initialization. If you do that then it should be perfectly safe.
精彩评论