FELIX-5006 : EventAdmin threads should be named

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1698178 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/eventadmin/impl/changelog.txt b/eventadmin/impl/changelog.txt
index 7479a8f..1a0097c 100644
--- a/eventadmin/impl/changelog.txt
+++ b/eventadmin/impl/changelog.txt
@@ -1,3 +1,9 @@
+Changes from 1.4.4 to 1.4.6
+---------------------------
+** Improvement
+    * [FELIX-5006] - EventAdmin threads should be named
+
+
 Changes from 1.4.2 to 1.4.4
 ---------------------------
 ** Improvement
diff --git a/eventadmin/impl/src/main/java/org/apache/felix/eventadmin/impl/tasks/DefaultThreadPool.java b/eventadmin/impl/src/main/java/org/apache/felix/eventadmin/impl/tasks/DefaultThreadPool.java
index 26c1e5e..c582fdf 100644
--- a/eventadmin/impl/src/main/java/org/apache/felix/eventadmin/impl/tasks/DefaultThreadPool.java
+++ b/eventadmin/impl/src/main/java/org/apache/felix/eventadmin/impl/tasks/DefaultThreadPool.java
@@ -20,6 +20,7 @@
 import java.util.concurrent.Executors;
 import java.util.concurrent.RejectedExecutionException;
 import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.atomic.AtomicLong;
 
 import org.apache.felix.eventadmin.impl.util.LogWrapper;
 
@@ -39,6 +40,8 @@
 
     private int oldSize = -1;
 
+    private final AtomicLong threadCounter = new AtomicLong(1);
+
     /**
      * Create a new pool.
      */
@@ -56,6 +59,7 @@
                     thread.setPriority( Thread.NORM_PRIORITY );
                     thread.setDaemon( true );
 
+                    thread.setName("EventAdminThread #" + threadCounter.getAndIncrement());
                     return thread;
                 }
             };