Ensure read lock is obtained before write lock is released on an error condition
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 5 Mar 2010 09:35:17 +0000 (09:35 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 5 Mar 2010 09:35:17 +0000 (09:35 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@919347 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/juli/FileHandler.java

index 8a1f0bd..210e8e1 100644 (file)
@@ -145,10 +145,10 @@ public class FileHandler
                     date = tsDate;
                     openWriter();
                 }
+            } finally {
                 // Down grade to read-lock. This ensures the writer remains valid
                 // until the log message is written
                 writerLock.readLock().lock();
-            } finally {
                 writerLock.writeLock().unlock();
             }
         }