wyhasany commented on code in PR #230:
URL: https://github.com/apache/commons-pool/pull/230#discussion_r1532175327
##########
src/main/java/org/apache/commons/pool3/impl/BaseGenericObjectPool.java:
##########
@@ -1617,7 +1624,8 @@ public final void setTestWhileIdle(final boolean
testWhileIdle) {
* @param delay duration before start and between eviction runs.
*/
final void startEvictor(final Duration delay) {
- synchronized (evictionLock) {
+ try {
+ evictionLock.lock();
Review Comment:
the very same goes for other places in code
##########
src/main/java/org/apache/commons/pool3/impl/BaseGenericObjectPool.java:
##########
@@ -1617,7 +1624,8 @@ public final void setTestWhileIdle(final boolean
testWhileIdle) {
* @param delay duration before start and between eviction runs.
*/
final void startEvictor(final Duration delay) {
- synchronized (evictionLock) {
+ try {
+ evictionLock.lock();
Review Comment:
locking should be done before try block to avoid unlocking not locked lock
when locking method throws an exception
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]