org.holoeverywhere.util.SynchronizedPool Maven / Gradle / Ivy
package org.holoeverywhere.util;
public class SynchronizedPool> implements Pool {
private final Object mLock;
private final Pool mPool;
public SynchronizedPool(Pool pool) {
mPool = pool;
mLock = this;
}
public SynchronizedPool(Pool pool, Object lock) {
mPool = pool;
mLock = lock;
}
@Override
public T acquire() {
synchronized (mLock) {
return mPool.acquire();
}
}
@Override
public void release(T element) {
synchronized (mLock) {
mPool.release(element);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy