Chapter 3 - Recipe #2: Controlling concurrent access to multiple copies of a resource - counting semaphore