the task to run once permits are available
a future that completes once permitCount permits are available AND task completes. task is started once permitCount permits are available. The permits are removed from the pool while task is running and after task completes the permits are returned to the pool.
java.lang.IllegalArgumentException
if the number of requested permits
exceeds maxAvailablePermits
the current number of permits available
the count of callers currently waiting on permits to become available
The default implementation of Semaphore using a ListBuffer backend. maxAvailablePermits is not defined and a hook for making new permits available is provided.