You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2015/11/02 15:14:11 UTC

svn commit: r1712003 - /tomcat/trunk/java/org/apache/tomcat/jni/Library.java

Author: markt
Date: Mon Nov  2 14:14:10 2015
New Revision: 1712003

URL: http://svn.apache.org/viewvc?rev=1712003&view=rev
Log:
Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=58058
Ensure only one thread can attempt to initialize the APR library at a time

Modified:
    tomcat/trunk/java/org/apache/tomcat/jni/Library.java

Modified: tomcat/trunk/java/org/apache/tomcat/jni/Library.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/jni/Library.java?rev=1712003&r1=1712002&r2=1712003&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/jni/Library.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/jni/Library.java Mon Nov  2 14:14:10 2015
@@ -162,10 +162,13 @@ public final class Library {
      * Setup any APR internal data structures.  This MUST be the first function
      * called for any APR library.
      * @param libraryName the name of the library to load
+     *
+     * @return {@code true} if the native code was initialized successfully
+     *         otherwise {@code false}
+     *
+     * @throws Exception if a problem occurred during initialization
      */
-    public static boolean initialize(String libraryName)
-        throws Exception
-    {
+    public synchronized static boolean initialize(String libraryName) throws Exception {
         if (_instance == null) {
             if (libraryName == null)
                 _instance = new Library();



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org