summaryrefslogtreecommitdiffhomepage
path: root/Stars45/SoundD3D.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Stars45/SoundD3D.cpp')
-rw-r--r--Stars45/SoundD3D.cpp9
1 files changed, 5 insertions, 4 deletions
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 <mmsystem.h>
#include <dsound.h>
+#include <mutex>
#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<std::mutex> lock(sync);
ListIter<Sound> iter = sounds;
while (++iter) {
@@ -321,7 +322,7 @@ SoundCardD3D::Pause()
bool
SoundCardD3D::Resume()
{
- AutoThreadSync a(sync);
+ const std::lock_guard<std::mutex> lock(sync);
ListIter<Sound> iter = sounds;
while (++iter) {
@@ -339,7 +340,7 @@ SoundCardD3D::Resume()
bool
SoundCardD3D::StopSoundEffects()
{
- AutoThreadSync a(sync);
+ const std::lock_guard<std::mutex> 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<std::mutex> lock(sync);
if (sound_check) sound_check->Update(this);