mirror of
				https://git.suyu.dev/suyu/suyu
				synced 2025-11-04 00:49:02 -06:00 
			
		
		
		
	Merge pull request #408 from Subv/mutex
Mutex: Add the calling thread to the waiting list when needed
This commit is contained in:
		@@ -168,9 +168,9 @@ Handle CreateMutex(bool initial_locked, const std::string& name) {
 | 
			
		||||
ResultVal<bool> Mutex::WaitSynchronization() {
 | 
			
		||||
    bool wait = locked;
 | 
			
		||||
    if (locked) {
 | 
			
		||||
        waiting_threads.push_back(GetCurrentThreadHandle());
 | 
			
		||||
        Kernel::WaitCurrentThread(WAITTYPE_MUTEX, GetHandle());
 | 
			
		||||
    }
 | 
			
		||||
    else {
 | 
			
		||||
    } else {
 | 
			
		||||
        // Lock the mutex when the first thread accesses it
 | 
			
		||||
        locked = true;
 | 
			
		||||
        MutexAcquireLock(this);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user