Properly wait for task termination (if any), this allow a more synchronous shutdown

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1487780 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/extender/internal/queue/ExecutorQueueService.java b/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/extender/internal/queue/ExecutorQueueService.java
index 0da4057..9e801fb 100644
--- a/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/extender/internal/queue/ExecutorQueueService.java
+++ b/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/extender/internal/queue/ExecutorQueueService.java
@@ -97,6 +97,12 @@
      */
     public void stop() {
         m_executorService.shutdown();
+        // Wait for potential executed tasks to finish their executions
+        try {
+            m_executorService.awaitTermination(1, TimeUnit.SECONDS);
+        } catch (InterruptedException e) {
+            // Ignored
+        }
         super.stop();
     }