hrydgard/ppsspp — pull request #54 by unknownbrackets (2012-11-16 10:22:19+00:00)
Title: Semaphore func cleanup

So, I wrote a bunch of tests (all together and messy, though, need to clean them up) on semaphores.

This fixes a bunch of the differences I noted, with the exception of:

* I was able to create about 2900 semaphores before getting 80020199, PPSSPP asserts after < 2048. But maybe it differs by hardware and this is fine. Note that PSPLINK hung (hard) after creating that many, anyway...

* Thread priority isn't working right, so I haven't messed with the priority attr much yet.

* Timeouts still aren't handled.
Since the ptr gets the expired seconds, I'm thinking `__KernelWaitCurThread` will need to take a u32 ptr? Downside is, that wouldn't allow non-user code to do a timeout (but nothing is right now.)
Also, seems like `__KernelNextThread` would be the best place to implement the timeout, maybe.

Probably all of the above will apply equally to mutexes as well.

-[Unknown]