diff --git a/apps/openmw/mwsound/openal_output.cpp b/apps/openmw/mwsound/openal_output.cpp index 39e872b0c..ccb3f22b5 100644 --- a/apps/openmw/mwsound/openal_output.cpp +++ b/apps/openmw/mwsound/openal_output.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include @@ -279,7 +280,7 @@ private: std::unique_ptr mLoudnessAnalyzer; - volatile bool mIsFinished; + std::atomic mIsFinished; void updateAll(bool local); @@ -313,7 +314,7 @@ struct OpenAL_Output::StreamThread : public OpenThreads::Thread { typedef std::vector StreamVec; StreamVec mStreams; - volatile bool mQuitNow; + std::atomic mQuitNow; OpenThreads::Mutex mMutex; OpenThreads::Condition mCondVar; diff --git a/apps/openmw/mwworld/cellpreloader.cpp b/apps/openmw/mwworld/cellpreloader.cpp index a06c208b5..3bf66a5a1 100644 --- a/apps/openmw/mwworld/cellpreloader.cpp +++ b/apps/openmw/mwworld/cellpreloader.cpp @@ -1,5 +1,7 @@ #include "cellpreloader.hpp" +#include + #include #include #include @@ -159,7 +161,7 @@ namespace MWWorld MWRender::LandManager* mLandManager; bool mPreloadInstances; - volatile bool mAbort; + std::atomic mAbort; osg::ref_ptr mTerrainView; @@ -392,7 +394,7 @@ namespace MWWorld } private: - volatile bool mAbort; + std::atomic mAbort; std::vector > mTerrainViews; Terrain::World* mWorld; std::vector mPreloadPositions; diff --git a/components/sceneutil/workqueue.hpp b/components/sceneutil/workqueue.hpp index 2084df328..0b16db0e7 100644 --- a/components/sceneutil/workqueue.hpp +++ b/components/sceneutil/workqueue.hpp @@ -9,6 +9,7 @@ #include #include +#include #include namespace SceneUtil @@ -87,7 +88,7 @@ namespace SceneUtil private: WorkQueue* mWorkQueue; - volatile bool mActive; + std::atomic mActive; }; diff --git a/extern/osg-ffmpeg-videoplayer/videostate.hpp b/extern/osg-ffmpeg-videoplayer/videostate.hpp index a60d6032f..6abaa64cd 100644 --- a/extern/osg-ffmpeg-videoplayer/videostate.hpp +++ b/extern/osg-ffmpeg-videoplayer/videostate.hpp @@ -2,6 +2,7 @@ #define VIDEOPLAYER_VIDEOSTATE_H #include +#include #include #include #include @@ -78,7 +79,7 @@ struct PacketQueue { { clear(); } AVPacketList *first_pkt, *last_pkt; - volatile bool flushing; + std::atomic flushing; int nb_packets; int size; @@ -169,12 +170,12 @@ struct VideoState { std::unique_ptr parse_thread; std::unique_ptr video_thread; - volatile bool mSeekRequested; + std::atomic mSeekRequested; uint64_t mSeekPos; - volatile bool mVideoEnded; - volatile bool mPaused; - volatile bool mQuit; + std::atomic mVideoEnded; + std::atomic mPaused; + std::atomic mQuit; }; }