< prev index next >

src/jdk.jdi/share/classes/com/sun/jdi/VirtualMachine.java

Print this page
*** 1,7 ***
  /*
!  * Copyright (c) 1998, 2020, 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
--- 1,7 ---
  /*
!  * 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

*** 248,24 ***
       * @since 1.4
       */
      void redefineClasses(Map<? extends ReferenceType,byte[]> classToBytes);
  
      /**
!      * Returns a list of the currently running threads. For each
!      * running thread in the target VM, a {@link ThreadReference}
!      * that mirrors it is placed in the list.
!      * The returned list contains threads created through
!      * java.lang.Thread, all native threads attached to
!      * the target VM through JNI, and system threads created
!      * by the target VM. Thread objects that have
!      * not yet been started
       * (see {@link java.lang.Thread#start Thread.start()})
       * and thread objects that have
       * completed their execution are not included in the returned list.
       *
       * @return a list of {@link ThreadReference} objects, one for each
!      * running thread in the mirrored VM.
       */
      List<ThreadReference> allThreads();
  
      /**
       * Suspends the execution of the application running in this
--- 248,25 ---
       * @since 1.4
       */
      void redefineClasses(Map<? extends ReferenceType,byte[]> classToBytes);
  
      /**
!      * Returns a list of the live
!      * <a href="{@docRoot}/java.base/java/lang/Thread.html#platform-threads">platform
!      * threads</a> in the target VM. The returned list contains a {@link ThreadReference}
!      * mirror for each live platform thread that is attached to the VM. The list does
!      * not contain elements for virtual threads.
!      * <p>
!      * The returned list contains the platform threads created with the {@link Thread}
!      * API, and all native threads attached to the target VM through JNI.
+      * Thread objects that have not yet been started
       * (see {@link java.lang.Thread#start Thread.start()})
       * and thread objects that have
       * completed their execution are not included in the returned list.
       *
       * @return a list of {@link ThreadReference} objects, one for each
!      * live platform thread in the mirrored VM.
       */
      List<ThreadReference> allThreads();
  
      /**
       * Suspends the execution of the application running in this

*** 783,10 ***
--- 784,27 ---
       */
      default boolean canGetModuleInfo() {
          return false;
      }
  
+     /**
+      * Determine if the target VM support virtual threads.
+      *
+      * @return {@code true} if the feature is supported, {@code false} otherwise
+      *
+      * @apiNote
+      * This is a temporary method to test the capability of the target VM.
+      *
+      * @implSpec
+      * The default implementation returns {@code false}.
+      *
+      * @since 99
+      */
+     default boolean supportsVirtualThreads() {
+         return false;
+     }
+ 
      /**
       * Set this VM's default stratum (see {@link Location} for a
       * discussion of strata).  Overrides the per-class default set
       * in the class file.
       * <P>
< prev index next >