summaryrefslogtreecommitdiffhomepage
path: root/Stars45/SoundD3D.cpp
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2022-03-27 22:11:07 +0200
committerAki <please@ignore.pl>2022-03-27 22:11:07 +0200
commit1cf689a6ad9d6c5cd29e11a6a96cb075eb2bbbb8 (patch)
tree3b31cdfcefe051a9a31972703b4d738812467abf /Stars45/SoundD3D.cpp
parent2ba515370864b85bd29b0d23083248c74a868691 (diff)
downloadstarshatter-1cf689a6ad9d6c5cd29e11a6a96cb075eb2bbbb8.zip
starshatter-1cf689a6ad9d6c5cd29e11a6a96cb075eb2bbbb8.tar.gz
starshatter-1cf689a6ad9d6c5cd29e11a6a96cb075eb2bbbb8.tar.bz2
Replaced ThreadSync with stl's mutex
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);