commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scolebou...@apache.org
Subject svn commit: r490987 - /jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileCleaner.java
Date Fri, 29 Dec 2006 12:11:48 GMT
Author: scolebourne
Date: Fri Dec 29 04:11:48 2006
New Revision: 490987

URL: http://svn.apache.org/viewvc?view=rev&rev=490987
Log:
Document synchronization

Modified:
    jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileCleaner.java

Modified: jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileCleaner.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileCleaner.java?view=diff&rev=490987&r1=490986&r2=490987
==============================================================================
--- jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileCleaner.java (original)
+++ jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileCleaner.java Fri Dec
29 04:11:48 2006
@@ -49,7 +49,7 @@
     /**
      * Collection of <code>Tracker</code> instances in existence.
      */
-    static Collection /* Tracker */ trackers = new Vector();
+    static Collection /* Tracker */ trackers = new Vector();  // synchronized
     /**
      * Whether to terminate the thread when the tracking is complete.
      */
@@ -128,6 +128,7 @@
      * @param deleteStrategy  the strategy to delete the file, null means normal
      */
     private static synchronized void addTracker(String path, Object marker, FileDeleteStrategy
deleteStrategy) {
+        // synchronized block protects reaper
         if (exitWhenFinished) {
             throw new IllegalStateException("No new trackers can be added once exitWhenFinished()
is called");
         }
@@ -171,6 +172,7 @@
      * One called, no new objects can be tracked by the file cleaner.
      */
     public static synchronized void exitWhenFinished() {
+        // synchronized block protects reaper
         exitWhenFinished = true;
         if (reaper != null) {
             synchronized (reaper) {
@@ -179,7 +181,7 @@
         }
     }
 
-    // -----------------------------------------------------------------------
+    //-----------------------------------------------------------------------
     /**
      * The reaper thread.
      */



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


Mime
View raw message