INT-3520: Correct usage of `Semaphore`