1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-07 02:45:31 +00:00

Improve locking

This commit is contained in:
scrawl 2015-07-10 17:13:07 +02:00
parent c2efafb313
commit 95ae862ed1

View file

@ -216,7 +216,7 @@ struct OpenAL_Output::StreamThread {
std::mutex mMutex;
std::thread mThread;
std::condition_variable mCondition;
volatile bool mExit;
bool mExit;
StreamThread()
: mThread(std::ref(*this))
@ -236,9 +236,9 @@ struct OpenAL_Output::StreamThread {
// std::thread entry point
void operator()()
{
std::unique_lock<std::mutex> lock (mMutex);
while(!mExit)
{
std::unique_lock<std::mutex> lock (mMutex);
StreamVec::iterator iter = mStreams.begin();
while(iter != mStreams.end())
{