a class to  limit the count of the threads that can access to some shared resource.