forked from teamnwah/openmw-tes3coop
Improve locking
This commit is contained in:
parent
c2efafb313
commit
95ae862ed1
1 changed files with 2 additions and 2 deletions
|
@ -216,7 +216,7 @@ struct OpenAL_Output::StreamThread {
|
||||||
std::mutex mMutex;
|
std::mutex mMutex;
|
||||||
std::thread mThread;
|
std::thread mThread;
|
||||||
std::condition_variable mCondition;
|
std::condition_variable mCondition;
|
||||||
volatile bool mExit;
|
bool mExit;
|
||||||
|
|
||||||
StreamThread()
|
StreamThread()
|
||||||
: mThread(std::ref(*this))
|
: mThread(std::ref(*this))
|
||||||
|
@ -236,9 +236,9 @@ struct OpenAL_Output::StreamThread {
|
||||||
// std::thread entry point
|
// std::thread entry point
|
||||||
void operator()()
|
void operator()()
|
||||||
{
|
{
|
||||||
|
std::unique_lock<std::mutex> lock (mMutex);
|
||||||
while(!mExit)
|
while(!mExit)
|
||||||
{
|
{
|
||||||
std::unique_lock<std::mutex> lock (mMutex);
|
|
||||||
StreamVec::iterator iter = mStreams.begin();
|
StreamVec::iterator iter = mStreams.begin();
|
||||||
while(iter != mStreams.end())
|
while(iter != mStreams.end())
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue