reta commented on code in PR #2571:
URL: https://github.com/apache/cxf/pull/2571#discussion_r2299411161


##########
rt/transports/http/src/main/java/org/apache/cxf/transport/http/HttpClientHTTPConduit.java:
##########
@@ -127,62 +128,95 @@ private static final class RefCount<T extends HttpClient> 
{
             this.finalizer = finalizer;
         }
 
-        RefCount<T> acquire() {
-            count.incrementAndGet();
+        /**
+         * Acquire a reference. Throws if shutdown has begun.
+         */
+        synchronized RefCount<T> acquire() {
+            if (shuttingDown) {

Review Comment:
   ```
      RefCount<T> acquire() {
               while (true) {
                   final long c = count.get();
                   if (c == 0L) {
                       throw new IllegalStateException("The client is already 
shutdown");
                   } else if (count.compareAndSet(c, c + 1)) {
                       break;
                   }
               }
               return this;
           }
   ```



-- 
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: dev-unsubscr...@cxf.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to