In a multi-threaded C++ app, do I need a mutex to protect a simple boolean?

后端 未结 5 1214
梦如初夏
梦如初夏 2020-12-15 22:54

I have a multi-threaded C++ app which does 3D rendering with the OpenSceneGraph library. I\'m planning to kick off OSG\'s render loop as a separate thread using boost::threa

5条回答
  •  感动是毒
    2020-12-15 23:25

    This thread has a little more info and discussion on thread-safety, especially for simple data types:

    How can I create a thread-safe singleton pattern in Windows?

提交回复
热议问题