diff options
author | Aki <please@ignore.pl> | 2022-03-27 22:11:07 +0200 |
---|---|---|
committer | Aki <please@ignore.pl> | 2022-03-27 22:11:07 +0200 |
commit | 1cf689a6ad9d6c5cd29e11a6a96cb075eb2bbbb8 (patch) | |
tree | 3b31cdfcefe051a9a31972703b4d738812467abf /Stars45/SoundCard.cpp | |
parent | 2ba515370864b85bd29b0d23083248c74a868691 (diff) | |
download | starshatter-1cf689a6ad9d6c5cd29e11a6a96cb075eb2bbbb8.zip starshatter-1cf689a6ad9d6c5cd29e11a6a96cb075eb2bbbb8.tar.gz starshatter-1cf689a6ad9d6c5cd29e11a6a96cb075eb2bbbb8.tar.bz2 |
Replaced ThreadSync with stl's mutex
Diffstat (limited to 'Stars45/SoundCard.cpp')
-rw-r--r-- | Stars45/SoundCard.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
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 <mutex> + #include "SoundCard.h" #include "Sound.h" @@ -72,7 +74,7 @@ SoundCard::UpdateThread() void SoundCard::Update() { - AutoThreadSync a(sync); + const std::lock_guard<std::mutex> lock(sync); ListIter<Sound> iter = sounds; while (++iter) { @@ -93,7 +95,7 @@ SoundCard::Update() void SoundCard::AddSound(Sound* s) { - AutoThreadSync a(sync); + const std::lock_guard<std::mutex> lock(sync); if (!sounds.contains(s)) sounds.append(s); |