mirror of
				https://git.suyu.dev/suyu/suyu
				synced 2025-11-04 00:49:02 -06:00 
			
		
		
		
	Mutex: Moved ReleaseMutex iterator declaration to be inside while loop.
This commit is contained in:
		@@ -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);
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user