coxlinton commented on a change in pull request #137: HTTPCORE-589 Fix 
LaxConnPool to ensure pending requests assigned connections
URL: 
https://github.com/apache/httpcomponents-core/pull/137#discussion_r314172817
 
 

 ##########
 File path: httpcore5/src/main/java/org/apache/hc/core5/pool/LaxConnPool.java
 ##########
 @@ -392,17 +395,17 @@ public void shutdown(final CloseMode closeMode) {
             }
         }
 
-        private boolean allocatePoolEntry() {
+        private PoolEntry<T, C> createPoolEntry() {
             final int poolmax = max;
             int prev, next;
             do {
                 prev = allocated.get();
                 next = (prev<poolmax)? prev+1 : prev;
             } while (!allocated.compareAndSet(prev, next));
-            return prev < next;
+            return (prev < next)? new PoolEntry<T,C>(route, timeToLive) : null;
         }
 
-        private void deallocatePoolEntry() {
+        private void disposePoolEntry(final PoolEntry<T, C> entry) {
 
 Review comment:
   I intentionally created this method to be the matched pair to the concept of 
createPoolEntry: one method creates a new pool entry for the pool, the other is 
used for "the reverse of that"; the right description of that it the tricky 
thing :) Although the entry param currently isn't used, imagine a modification 
of the pool structure where we maintain a master list of all pool entries: then 
createPoolEntry would add the new entry to the master list, and 
disposePoolEntry would remove the entry from the master list. Would 
discardPoolEntry be any better?
   But perhaps that's all unnecessary and I could just leave it as the 
previously declared deallocatePoolEntry - it's not really quite the exact 
analogue of createPoolEntry, but does accurately describe the current function 
of the method.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to