citra-emu/citra — pull request #318 by bunnei (2014-12-20 07:39:14+00:00)
Title: Thread: Wait current thread on svc_SleepThread

Fixed svc_SleepThread to actually block the current thread and initiate a context switch. However, there is no timing mechanism yet to wake up a thread if it has been put to sleep. So, we'll just immediately set it to "ready" again after an attempted context switch has occurred. This results in the current thread yielding on a sleep once, and then it will be immediately be placed back in the queue for execution. Without this change, threads would never block on Sleep, and therefore threads that were a lower priority [than the current thread] could be starved.

This fixes Citra for https://github.com/smealum/3dscraft.

Additional changes:
- Removed unused VBLANK sleep mode
- Added error log for bad context switch