10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 package com.sun.jdi;
27
28 import java.util.List;
29 import com.sun.jdi.event.EventSet;
30 import jdk.internal.javac.PreviewFeature;
31
32 /**
33 * A thread object from the target VM.
34 * A ThreadReference is an {@link ObjectReference} with additional
35 * access to thread-specific information from the target VM.
36 *
37 * @author Robert Field
38 * @author Gordon Hirsch
39 * @author James McIlree
40 * @since 1.3
41 */
42 public interface ThreadReference extends ObjectReference {
43
44 /** Thread status is unknown */
45 public final int THREAD_STATUS_UNKNOWN =-1;
46 /** Thread has completed execution */
47 public final int THREAD_STATUS_ZOMBIE = 0;
48 /** Thread is runnable */
49 public final int THREAD_STATUS_RUNNING = 1;
50 /** Thread is sleeping - {@link Thread#sleep(long)}. */
499 * been loaded through the appropriate class loader.
500 *
501 * @throws VMCannotBeModifiedException if the VirtualMachine is read-only.
502 *
503 * @since 1.6
504 * @see VirtualMachine#canBeModified()
505 */
506 void forceEarlyReturn(Value value) throws InvalidTypeException,
507 ClassNotLoadedException,
508 IncompatibleThreadStateException;
509
510 /**
511 * Returns {@code true} if the thread is a
512 * <a href="{@docRoot}/java.base/java/lang/Thread.html#virtual-threads">virtual thread</a>.
513 *
514 * @return true if the thread is a virtual thread
515 *
516 * @implSpec
517 * The default implementation throws {@code UnsupportedOperationException}.
518 *
519 * @since 19
520 */
521 @PreviewFeature(feature = PreviewFeature.Feature.VIRTUAL_THREADS, reflective = true)
522 default boolean isVirtual() {
523 throw new UnsupportedOperationException("Method not implemented");
524 }
525 }
|
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 package com.sun.jdi;
27
28 import java.util.List;
29 import com.sun.jdi.event.EventSet;
30
31 /**
32 * A thread object from the target VM.
33 * A ThreadReference is an {@link ObjectReference} with additional
34 * access to thread-specific information from the target VM.
35 *
36 * @author Robert Field
37 * @author Gordon Hirsch
38 * @author James McIlree
39 * @since 1.3
40 */
41 public interface ThreadReference extends ObjectReference {
42
43 /** Thread status is unknown */
44 public final int THREAD_STATUS_UNKNOWN =-1;
45 /** Thread has completed execution */
46 public final int THREAD_STATUS_ZOMBIE = 0;
47 /** Thread is runnable */
48 public final int THREAD_STATUS_RUNNING = 1;
49 /** Thread is sleeping - {@link Thread#sleep(long)}. */
498 * been loaded through the appropriate class loader.
499 *
500 * @throws VMCannotBeModifiedException if the VirtualMachine is read-only.
501 *
502 * @since 1.6
503 * @see VirtualMachine#canBeModified()
504 */
505 void forceEarlyReturn(Value value) throws InvalidTypeException,
506 ClassNotLoadedException,
507 IncompatibleThreadStateException;
508
509 /**
510 * Returns {@code true} if the thread is a
511 * <a href="{@docRoot}/java.base/java/lang/Thread.html#virtual-threads">virtual thread</a>.
512 *
513 * @return true if the thread is a virtual thread
514 *
515 * @implSpec
516 * The default implementation throws {@code UnsupportedOperationException}.
517 *
518 * @since 21
519 */
520 default boolean isVirtual() {
521 throw new UnsupportedOperationException("Method not implemented");
522 }
523 }
|