< prev index next >

src/jdk.jdi/share/classes/com/sun/jdi/request/ThreadStartRequest.java

Print this page
@@ -1,7 +1,7 @@
  /*
-  * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+  * Copyright (c) 1998, 2021, Oracle and/or its affiliates. All rights reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.  Oracle designates this

@@ -27,10 +27,11 @@
  
  import com.sun.jdi.ThreadReference;
  import com.sun.jdi.event.EventQueue;
  import com.sun.jdi.event.EventSet;
  import com.sun.jdi.event.ThreadStartEvent;
+ import jdk.internal.javac.PreviewFeature;
  
  /**
   * Request for notification when a thread starts execution in the target VM.
   * When an enabled ThreadStartRequest is hit, an
   * {@link EventSet event set} containing a

@@ -50,12 +51,33 @@
  public interface ThreadStartRequest extends EventRequest {
  
      /**
       * Restricts the events generated by this request to those in
       * the given thread.
+      * The behavior of this method is unspecified when the event is restricted
+      * to only platform threads.
       * @param thread the thread to filter on.
       * @throws InvalidRequestStateException if this request is currently
       * enabled or has been deleted.
       * Filters may be added only to disabled requests.
       */
      void addThreadFilter(ThreadReference thread);
+ 
+     /**
+      * Restricts the events generated by this request to only
+      * <a href="{@docRoot}/java.base/java/lang/Thread.html#platform-threads">platform threads</a>.
+      * The behavior of this method is unspecified when the event is restricted
+      * to a specific thread.
+      *
+      * @implSpec
+      * The default implementation throws {@code UnsupportedOperationException}.
+      *
+      * @throws InvalidRequestStateException if this request is currently
+      * enabled or has been deleted
+      *
+      * @since 99
+      */
+     @PreviewFeature(feature = PreviewFeature.Feature.VIRTUAL_THREADS)
+     default void addPlatformThreadsOnlyFilter() {
+         throw new UnsupportedOperationException("Method not implemented");
+     }
  }
< prev index next >