felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pde...@apache.org
Subject svn commit: r1776590 - /felix/trunk/dependencymanager/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ComponentImpl.java
Date Fri, 30 Dec 2016 15:29:28 GMT
Author: pderop
Date: Fri Dec 30 15:29:28 2016
New Revision: 1776590

URL: http://svn.apache.org/viewvc?rev=1776590&view=rev
Log:
FELIX-5471: do not use the threadpool (if one is configured) for dependency removal events.

Modified:
    felix/trunk/dependencymanager/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ComponentImpl.java

Modified: felix/trunk/dependencymanager/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ComponentImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ComponentImpl.java?rev=1776590&r1=1776589&r2=1776590&view=diff
==============================================================================
--- felix/trunk/dependencymanager/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ComponentImpl.java
(original)
+++ felix/trunk/dependencymanager/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ComponentImpl.java
Fri Dec 30 15:29:28 2016
@@ -1682,7 +1682,13 @@ public class ComponentImpl implements Co
     private void schedule(boolean synchronously, Runnable task) {
     	if (synchronously) {
     		FutureTask<Void> future = new FutureTask<Void>(task, null);
-    		getExecutor().execute(future);
+    		Executor exec = getExecutor();
+    		if (exec instanceof DispatchExecutor) {
+    			// try to invoke the future from the current thread, not using the threadpool.
+    			((DispatchExecutor) exec).execute(future, false);
+    		} else {
+    			exec.execute(future);
+    		}
     		try {
 				future.get(DependencyManager.SCHEDUME_TIMEOUT_VAL, TimeUnit.MILLISECONDS);
 			} catch (InterruptedException | ExecutionException | TimeoutException e) {



Mime
View raw message