mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-04-30 11:14:21 +00:00
N3DS: Semaphore fixes. (#6776)
* N3DS: Make Sem waits cooperative friendly. The 3DS has a cooperative threading model. Sleeping after TryWait and WaitTimeout avoid starving other threads. It inccurs a runtime penalty, but it's better than having to hard reset your console to recover from a deadlock.
This commit is contained in:
@@ -208,6 +208,8 @@ TestOverheadContended(SDL_bool try_wait)
|
||||
}
|
||||
/* Make sure threads consumed everything */
|
||||
while (SDL_SemValue(sem)) {
|
||||
/* Friendlier with cooperative threading models */
|
||||
SDL_DelayNS(1);
|
||||
}
|
||||
}
|
||||
end_ticks = SDL_GetTicks();
|
||||
|
||||
Reference in New Issue
Block a user