Pregunta de entrevista de NVIDIA

implement a semaphore, not very difficult.