Casebash
Casebash

Reputation: 118832

Is AfxBeginThread safe?

According 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?

Upvotes: 0

Views: 679

Answers (1)

Mark Ransom
Mark Ransom

Reputation: 308206

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.

Upvotes: 1

Related Questions