Skip to content
Snippets Groups Projects
Commit 780a443b authored by bunnei's avatar bunnei
Browse files

Mutex: Moved ReleaseMutex iterator declaration to be inside while loop.

parent 8cac527c
No related branches found
No related tags found
No related merge requests found
......@@ -100,11 +100,10 @@ bool ReleaseMutexForThread(Mutex* mutex, Handle thread) {
bool ReleaseMutex(Mutex* mutex) {
MutexEraseLock(mutex);
bool woke_threads = false;
std::vector<Handle>::iterator iter;
// Find the next waiting thread for the mutex...
while (!woke_threads && !mutex->waiting_threads.empty()) {
iter = mutex->waiting_threads.begin();
std::vector<Handle>::iterator iter = mutex->waiting_threads.begin();
woke_threads |= ReleaseMutexForThread(mutex, *iter);
mutex->waiting_threads.erase(iter);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment