From 1cf689a6ad9d6c5cd29e11a6a96cb075eb2bbbb8 Mon Sep 17 00:00:00 2001 From: Aki Date: Sun, 27 Mar 2022 22:11:07 +0200 Subject: Replaced ThreadSync with stl's mutex --- Stars45/SoundD3D.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'Stars45/SoundD3D.cpp') diff --git a/Stars45/SoundD3D.cpp b/Stars45/SoundD3D.cpp index 617c8d3..803b85a 100644 --- a/Stars45/SoundD3D.cpp +++ b/Stars45/SoundD3D.cpp @@ -17,6 +17,7 @@ #include #include +#include #include "SoundD3D.h" #include "Game.h" @@ -303,7 +304,7 @@ SoundCardD3D::SetListener(const Camera& cam, const Vec3& vel) bool SoundCardD3D::Pause() { - AutoThreadSync a(sync); + const std::lock_guard lock(sync); ListIter iter = sounds; while (++iter) { @@ -321,7 +322,7 @@ SoundCardD3D::Pause() bool SoundCardD3D::Resume() { - AutoThreadSync a(sync); + const std::lock_guard lock(sync); ListIter iter = sounds; while (++iter) { @@ -339,7 +340,7 @@ SoundCardD3D::Resume() bool SoundCardD3D::StopSoundEffects() { - AutoThreadSync a(sync); + const std::lock_guard lock(sync); DWORD ok_sounds = (Sound::INTERFACE | Sound::OGGVORBIS | Sound::RESOURCE); @@ -486,7 +487,7 @@ SoundD3D::Update() return; } - AutoThreadSync a(sync); + const std::lock_guard lock(sync); if (sound_check) sound_check->Update(this); -- cgit v1.1