return the number of processes waiting on the semaphore. We now maintiain
a count of waiting processes.
- Blocked processes are unblocked "first in, first out". We now have a
queue of waiting processes on a asemaphores, so that we can wakeup the
first blocked process.
Problems:
- We now have a lot of dynamic memory allocation, it may be a bit slow.
- Nothing is SMP safe for now. We need to add locks.
- On close, we forget about a semaphore, which is incorrect. One process
can close its fd attached on a semaphore, but other processes would carry
on using it. Since any process can join a shared arena, this is not an
easy thing to solve.
- A lot of usema/usync functionnalities are still to be discovered.