geronimo-xbean-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1613225 - /geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/AsynchronousInheritanceAnnotationFinder.java
Date Thu, 24 Jul 2014 18:09:14 GMT
Author: rmannibucau
Date: Thu Jul 24 18:09:14 2014
New Revision: 1613225

URL: http://svn.apache.org/r1613225
Log:
ensuring to flush tasks before destruction

Modified:
    geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/AsynchronousInheritanceAnnotationFinder.java

Modified: geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/AsynchronousInheritanceAnnotationFinder.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/AsynchronousInheritanceAnnotationFinder.java?rev=1613225&r1=1613224&r2=1613225&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/AsynchronousInheritanceAnnotationFinder.java
(original)
+++ geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/AsynchronousInheritanceAnnotationFinder.java
Thu Jul 24 18:09:14 2014
@@ -20,6 +20,7 @@ package org.apache.xbean.finder;
 
 import org.apache.xbean.finder.archive.Archive;
 
+import java.util.Collection;
 import java.util.List;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.ExecutorService;
@@ -42,7 +43,21 @@ public class AsynchronousInheritanceAnno
     }
 
     public void destroy() {
-        executor.shutdownNow();
+        final Collection<Runnable> tasks = executor.shutdownNow();
+
+        for (final Runnable r : tasks) {
+            r.run();
+        }
+
+        if (implementationsLatch != null) {
+            implementationsLatch.countDown();
+        }
+        implementationsLatch = null;
+
+        if (subclassesLatch != null) {
+            subclassesLatch.countDown();
+        }
+        subclassesLatch = null;
     }
 
     @Override // should be called from main thread



Mime
View raw message