开发者

Is AfxBeginThread safe?

开发者 https://www.devze.com 2023-02-02 12:27 出处:网络
Accor开发者_高级运维ding to this webpage: To safely use CWinThread, you must start the thread suspended and set the

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消