mirror of
				https://github.com/Ryujinx/SDL.git
				synced 2025-11-04 15:34:58 +00:00 
			
		
		
		
	Fixed time comparison and explicitly delay 1 ms instead of an arbitrary scheduled time.
This commit is contained in:
		
							parent
							
								
									f06eeb013b
								
							
						
					
					
						commit
						10ffa28a28
					
				| 
						 | 
				
			
			@ -156,10 +156,10 @@ SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout)
 | 
			
		|||
#else
 | 
			
		||||
    end = SDL_GetTicks() + timeout;
 | 
			
		||||
    while ((retval = SDL_SemTryWait(sem)) == SDL_MUTEX_TIMEDOUT) {
 | 
			
		||||
        if (SDL_GetTicks() >= end) {
 | 
			
		||||
        if ((Sint32)(SDL_GetTicks() - end) >= 0) {
 | 
			
		||||
            break;
 | 
			
		||||
        }
 | 
			
		||||
        SDL_Delay(0);
 | 
			
		||||
        SDL_Delay(1);
 | 
			
		||||
    }
 | 
			
		||||
#endif /* HAVE_SEM_TIMEDWAIT */
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue