10641065106610671068106910701071107210731074
WriteLock writeLock = readWriteLock.writeLock(); writeLock.lock(); try { keyedPool.clear(key); } finally { writeLock.unlock(); } } /** * {@inheritDoc}
10801081108210831084108510861087108810891090
try { keyedPool.close(); } catch (Exception e) { // swallowed as of Pool 2 } finally { writeLock.unlock(); } } /** * {@inheritDoc}
758759760761762763764765766767768
WriteLock writeLock = readWriteLock.writeLock(); writeLock.lock(); try { return pool.borrowObject(); } finally { writeLock.unlock(); } } /** * {@inheritDoc}
774775776777778779780781782783784
try { pool.returnObject(obj); } catch (Exception e) { // swallowed as of Pool 2 } finally { writeLock.unlock(); } } /** * {@inheritDoc}
790791792793794795796797798799800
try { pool.invalidateObject(obj); } catch (Exception e) { // swallowed as of Pool 2 } finally { writeLock.unlock(); } } /** * {@inheritDoc}
805806807808809810811812813814815
WriteLock writeLock = readWriteLock.writeLock(); writeLock.lock(); try { pool.addObject(); } finally { writeLock.unlock(); } } /** * {@inheritDoc}
847848849850851852853854855856857
WriteLock writeLock = readWriteLock.writeLock(); writeLock.lock(); try { pool.clear(); } finally { writeLock.unlock(); } } /** * {@inheritDoc}
863864865866867868869870871872873
try { pool.close(); } catch (Exception e) { // swallowed as of Pool 2 } finally { writeLock.unlock(); } } /** * {@inheritDoc}
8384858687888990919293
} // Downgrade the lock try { readLock.lock(); writeLock.unlock(); return doWriteInternal(b, off, len); } finally { readLock.unlock(); } } finally {
9293949596979899100101102
} } finally { // Should have been released above but may not have been on some // exception paths if (writeLock.isHeldByCurrentThread()) { writeLock.unlock(); } } }