summaryrefslogtreecommitdiffhomepage
path: root/Stars45/MusicDirector.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/MusicDirector.cpp
parent2ba515370864b85bd29b0d23083248c74a868691 (diff)
downloadstarshatter-1cf689a6ad9d6c5cd29e11a6a96cb075eb2bbbb8.zip
starshatter-1cf689a6ad9d6c5cd29e11a6a96cb075eb2bbbb8.tar.gz
starshatter-1cf689a6ad9d6c5cd29e11a6a96cb075eb2bbbb8.tar.bz2
Replaced ThreadSync with stl's mutex
Diffstat (limited to 'Stars45/MusicDirector.cpp')
-rw-r--r--Stars45/MusicDirector.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/Stars45/MusicDirector.cpp b/Stars45/MusicDirector.cpp
index 34e48a6..b2ff7ef 100644
--- a/Stars45/MusicDirector.cpp
+++ b/Stars45/MusicDirector.cpp
@@ -12,6 +12,7 @@
of background music tracks for both menu and game modes
*/
+#include <mutex>
#include "MusicDirector.h"
#include "MusicTrack.h"
@@ -20,7 +21,6 @@
#include "DataLoader.h"
#include "FormatUtil.h"
#include "Sound.h"
-#include "ThreadSync.h"
static MusicDirector* music_director = 0;
@@ -91,7 +91,7 @@ MusicDirector::ExecFrame()
{
if (no_music) return;
- AutoThreadSync a(sync);
+ const std::lock_guard<std::mutex> lock(sync);
if (next_track && !track) {
track = next_track;
@@ -273,7 +273,7 @@ MusicDirector::SetMode(int mode)
{
if (!music_director || music_director->no_music) return;
- AutoThreadSync a(music_director->sync);
+ const std::lock_guard<std::mutex> lock(music_director->sync);
// stay in intro mode until it is complete:
if (mode == MENU && (music_director->GetMode() == NONE ||