summaryrefslogtreecommitdiffhomepage
path: root/Stars45/RadioVox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Stars45/RadioVox.cpp')
-rw-r--r--Stars45/RadioVox.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/Stars45/RadioVox.cpp b/Stars45/RadioVox.cpp
index 2131aae..8942caf 100644
--- a/Stars45/RadioVox.cpp
+++ b/Stars45/RadioVox.cpp
@@ -11,6 +11,8 @@
View class for Radio Communications HUD Overlay
*/
+#include <mutex>
+
#include "RadioVox.h"
#include "RadioView.h"
#include "AudioConfig.h"
@@ -18,7 +20,6 @@
#include "DataLoader.h"
#include "Game.h"
#include "Sound.h"
-#include "ThreadSync.h"
// +====================================================================+
//
@@ -42,7 +43,7 @@ public:
bool shutdown;
HANDLE hthread;
List<RadioVox> queue;
- ThreadSync sync;
+ std::mutex sync;
};
static RadioVoxController* controller = 0;
@@ -100,7 +101,7 @@ RadioVoxController::UpdateThread()
void
RadioVoxController::Update()
{
- AutoThreadSync a(sync);
+ const std::lock_guard<std::mutex> lock(sync);
if (queue.size()) {
RadioVox* vox = queue.first();
@@ -116,7 +117,7 @@ RadioVoxController::Add(RadioVox* vox)
if (!vox || vox->sounds.isEmpty())
return false;
- AutoThreadSync a(sync);
+ const std::lock_guard<std::mutex> lock(sync);
if (queue.size() < MAX_QUEUE) {
queue.append(vox);