Code example for Lock

Methods: lockunlock

0
        // idletime can be 0 or negative, no problem there 
        if (tunit == null) {
            throw new IllegalArgumentException("Time unit must not be null.");
        } 
 
        poolLock.lock();
        try { 
            idleConnHandler.closeIdleConnections(tunit.toMillis(idletime));
        } finally { 
            poolLock.unlock();
        } 
    } 
 
    public void closeExpiredConnections() { 
        poolLock.lock();
        try { 
            idleConnHandler.closeExpiredConnections();
        } finally { 
            poolLock.unlock();
        } 
Stop searching for code, let great code find you!  Add Codota to your java IDE