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/SoundCard.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Stars45/SoundCard.cpp') diff --git a/Stars45/SoundCard.cpp b/Stars45/SoundCard.cpp index c0b1368..1e54cce 100644 --- a/Stars45/SoundCard.cpp +++ b/Stars45/SoundCard.cpp @@ -11,6 +11,8 @@ Abstract sound card class */ +#include + #include "SoundCard.h" #include "Sound.h" @@ -72,7 +74,7 @@ SoundCard::UpdateThread() void SoundCard::Update() { - AutoThreadSync a(sync); + const std::lock_guard lock(sync); ListIter iter = sounds; while (++iter) { @@ -93,7 +95,7 @@ SoundCard::Update() void SoundCard::AddSound(Sound* s) { - AutoThreadSync a(sync); + const std::lock_guard lock(sync); if (!sounds.contains(s)) sounds.append(s); -- cgit v1.1