Author: markt Date: Mon Jan 11 17:35:29 2016 New Revision: 1724094 URL: http://svn.apache.org/viewvc?rev=1724094&view=rev Log: Whoops. Fix regression in r1724015. Code was used although I can't see why a simple AtomicInteger wasn't sufficient.
Modified: tomcat/trunk/java/org/apache/tomcat/util/net/openssl/OpenSSLContext.java Modified: tomcat/trunk/java/org/apache/tomcat/util/net/openssl/OpenSSLContext.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/openssl/OpenSSLContext.java?rev=1724094&r1=1724093&r2=1724094&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/util/net/openssl/OpenSSLContext.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/net/openssl/OpenSSLContext.java Mon Jan 11 17:35:29 2016 @@ -25,7 +25,7 @@ import java.security.cert.X509Certificat import java.util.ArrayList; import java.util.Base64; import java.util.List; -import java.util.concurrent.atomic.AtomicIntegerFieldUpdater; +import java.util.concurrent.atomic.AtomicInteger; import javax.net.ssl.KeyManager; import javax.net.ssl.SSLEngine; @@ -84,10 +84,10 @@ public class OpenSSLContext implements o } private final long aprPool; + private final AtomicInteger aprPoolDestroyed = new AtomicInteger(0); + protected final long ctx; - private static final AtomicIntegerFieldUpdater<OpenSSLContext> DESTROY_UPDATER - = AtomicIntegerFieldUpdater.newUpdater(OpenSSLContext.class, "aprPoolDestroyed"); static final CertificateFactory X509_CERT_FACTORY; private static final String BEGIN_KEY = "-----BEGIN RSA PRIVATE KEY-----\n"; @@ -171,7 +171,7 @@ public class OpenSSLContext implements o @Override public synchronized void destroy() { // Guard against multiple destroyPools() calls triggered by construction exception and finalize() later - if (DESTROY_UPDATER.compareAndSet(this, 0, 1)) { + if (aprPoolDestroyed.compareAndSet(0, 1)) { if (ctx != 0) { SSLContext.free(ctx); } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org