This is an example of blocking semaphore. Semaphores in general are having two types- Busy waiting(Spin Lock) & Blocking.
Busy waiting semaphores halt the cpu because it runs in an indefinite loop until a signal terminate it whereas blocking semaphores blocks the execution of the process itself and move on. the idea is maintain a queue of all incoming processes. In P(S), check whether queue is empty or not, if not pop one process from queue and call the same process. do not call V(S).
This is exactly we are doing here. if are list is not empty, take one process from list and call this method again.