public int getMaxPermits() {
        return maxPermits;
    }
An implementation of adjustable semaphore.

Written by Marshall Pierce and released to the public domain
See: http://blog.teamlazerbeez.com/2009/04/20/javas-semaphore-resizing/
jraft-core/src/main/java/com/alipay/sofa/jraft/util/concurrent/AdjustableSemaphore.java