psteitz commented on PR #230:
URL: https://github.com/apache/commons-pool/pull/230#issuecomment-1899325662

   Returning back to this, I think we should eliminate the use of intrinsic 
locks here.  The example is a little strange, but I can imagine other scenarios 
where pinning happens due to the intrinsic locks on PooledObjects.  The code 
referenced in the PR acquires a lock on a PooledObject'ss monitor.  
DefaultPooledObject uses syncrhonized methods to guard state changes.  We 
obviously can't add an explicit lock to the PooledObject interface.  The 
simplest way that I can see to solve this is to add lock() and unlock() methods 
to the PooledObject interface, defaulted to no-ops (with warning labels) and 
implemented in DefaultPooledObject with a ReentrantLock.   Any better ideas?


-- 
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]

Reply via email to