Pregunta de entrevista de Optiver

One question about using semaphone to achieve threads synchronization.