Counting semaphores