Lock the semaphore, blocking until it becomes available. Since this
is done through a system call, this will block the *entire runtime*,
not just the current thread. If this is not the behaviour you want,
use semThreadWait instead.