1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-21 12:49:10 +00:00

Replace hsMutex with std::mutex

This commit is contained in:
2014-04-05 20:45:58 -07:00
parent 964256411e
commit 2947acb2c8
16 changed files with 166 additions and 342 deletions

View File

@ -57,6 +57,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plAudioFileReader.h"
#include "hsThread.h"
#include "plFileSystem.h"
#include <mutex>
//// Class Definition ////////////////////////////////////////////////////////
@ -165,7 +166,7 @@ protected:
hsTArray<plSoundBuffer*> fBuffers;
hsEvent fEvent;
bool fRunning;
hsMutex fCritSect;
std::mutex fCritSect;
public:
virtual hsError Run();
@ -184,9 +185,10 @@ public:
bool IsRunning() const { return fRunning; }
void AddBuffer(plSoundBuffer* buffer) {
fCritSect.Lock();
fBuffers.Push(buffer);
fCritSect.Unlock();
{
std::lock_guard<std::mutex> lock(fCritSect);
fBuffers.Push(buffer);
}
fEvent.Signal();
}