This week's book giveaway is in the Testing forum. We're giving away four copies of The Way of the Web Tester: A Beginner's Guide to Automating Tests and have Jonathan Rasmusson on-line! See this thread for details.
You adapt the Singleton class to manage and restrict the number of instances.
The implementation that is used by the Gang of Four checks if one instance exists. If yes, it returns that instance, if no, it creates a new one and returns that.
In your Singleton implementation, you will need to do the bookkeeping to count how many instances are existing, and create a new one if needed/allowed.
But then, which one of the 2 instances are you going to return? The first one? The second one? You will have to define the logic for that.