Make stream thread non-daemon and remove unnecessary copying of filter JEP-349-branch
authoregahlin
Thu, 29 Aug 2019 03:27:49 +0200
branchJEP-349-branch
changeset 57921 08327ab323c5
parent 57920 de358b994ad9
child 57922 6598f2825b1f
Make stream thread non-daemon and remove unnecessary copying of filter
src/jdk.jfr/share/classes/jdk/jfr/consumer/AbstractEventStream.java
src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/InternalEventFilter.java
--- a/src/jdk.jfr/share/classes/jdk/jfr/consumer/AbstractEventStream.java	Thu Aug 29 03:21:55 2019 +0200
+++ b/src/jdk.jfr/share/classes/jdk/jfr/consumer/AbstractEventStream.java	Thu Aug 29 03:27:49 2019 +0200
@@ -187,7 +187,7 @@
                 }
                 ef.setThreshold(name, 0);
             }
-            return ef.threadSafe();
+            return ef;
         }
 
         final public StreamConfiguration setReuse(boolean reuse) {
@@ -342,7 +342,6 @@
         // Create thread object in constructor to ensure caller has
         // permission before constructing object
         thread = new Thread(this);
-        thread.setDaemon(true);
     }
 
     public final void run() {
--- a/src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/InternalEventFilter.java	Thu Aug 29 03:21:55 2019 +0200
+++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/InternalEventFilter.java	Thu Aug 29 03:27:49 2019 +0200
@@ -39,12 +39,6 @@
         this(false, new HashMap<>());
     }
 
-    // returns an instance that can be passed to
-    // another thread safely
-    public InternalEventFilter threadSafe() {
-        return new InternalEventFilter(acceptAll, thresholds);
-    }
-
     private InternalEventFilter(boolean acceptAll, Map<String, Long> thresholds) {
         this.acceptAll = acceptAll;
         this.thresholds = thresholds;