Make mutex locks slightly more safe in some places (and correct in another...)

This commit is contained in:
Bart van Strien
2013-08-03 22:13:33 +02:00
parent 3e57cfd174
commit 1602c6de7a
2 changed files with 11 additions and 17 deletions
+5 -4
View File
@@ -58,10 +58,11 @@ bool Thread::start()
void Thread::wait()
{
mutex.lock();
if (!thread)
return;
mutex.unlock();
{
Lock l(mutex);
if (!thread)
return;
}
SDL_WaitThread(thread, 0);
Lock l(mutex);
running = false;