User
User

Reputation: 65961

Use boost::mutex with MFC threads (AfxBeginThread)?

Can you use the boost::mutex libraries to protect a critical section of code when you are not using boost::thread but instead using the MFC threading capability via AfxBeginThread? If so, are there any problems with doing this?

Upvotes: 4

Views: 663

Answers (2)

curiousguy
curiousguy

Reputation: 8268

A (real) thread is a (real) thread.

Boost makes no special assumptions about the fact that a thread has been created directly (Windows API) or via Boost.

Short answer:

No problem.

Upvotes: 1

Simon
Simon

Reputation: 1504

Yes, you can. There is no problem since both are using the Win32 API behind the scenes.

Upvotes: 0

Related Questions