In this case the semaphore is used for mutual exclusion. Before every access to seats the enter method of seatReservation is called. The initial semaphore counter number of 1 ensures that only one enter call can continue. The other one is blocked until leave is called. With this synchronization it is not possible to reserve one seat twice 7.1 .
Processes can use semaphores for synchronization even when they are spawned in a different context.