Updated documentation and comments.

This commit is contained in:
nathan 2017-03-09 14:48:41 +01:00
parent 7aceaacb0d
commit 85881c9bf3
2 changed files with 10 additions and 9 deletions

View File

@ -39,22 +39,23 @@ Usage:
/**
* Takes an object from the pool, Blocks until an item is available in the pool.
* Takes an object from the pool. If the pool is a {@link BlockingPool}, this will wait until an item is available in
* the pool.
* <p/>
* This method catches {@link InterruptedException} and discards it silently.
*/
T take();
/**
* Takes an object from the pool, Blocks until an item is available in the pool.
* Takes an object from the pool. If the pool is a {@link BlockingPool}, this will wait until an item is available in the pool.
*/
T takeInterruptibly() throws InterruptedException;
/**
* Return object to the pool, waking the threads that have blocked during take()
* Return object to the pool. If the pool is a {@link BlockingPool}, this will wake the threads that have blocked during take/takeInterruptibly()
*/
void put(T object);
/**
* @return a new object instance created by the pool.
*/

View File

@ -19,21 +19,21 @@ package dorkbox.objectPool;
* @author dorkbox, llc
*/
interface Pool<T> {
/**
* Takes an object from the pool, Blocks until an item is available in the pool.
* Takes an object from the pool. If the pool is a {@link BlockingPool}, this will wait until an item is available in
* the pool.
* <p/>
* This method catches {@link InterruptedException} and discards it silently.
*/
T take();
/**
* Takes an object from the pool, Blocks until an item is available in the pool.
* Takes an object from the pool. If the pool is a {@link BlockingPool}, this will wait until an item is available in the pool.
*/
T takeInterruptibly() throws InterruptedException;
/**
* Return object to the pool, waking the threads that have blocked during take()
* Return object to the pool. If the pool is a {@link BlockingPool}, this will wake the threads that have blocked during take/takeInterruptibly()
*/
void put(T object);