Skip to content

Commit

Permalink
Fix thread and threadgroup tests in compile stage
Browse files Browse the repository at this point in the history
- These files will be excluded in build.xml instead

Signed-off-by: LongyuZhang <[email protected]>
  • Loading branch information
LongyuZhang committed Jul 25, 2024
1 parent 446f0bd commit c38bdc0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 72 deletions.
38 changes: 0 additions & 38 deletions src/java.base/share/classes/java/lang/Thread.java
Original file line number Diff line number Diff line change
Expand Up @@ -1831,44 +1831,6 @@ boolean alive() {
return eetop != NO_REF;
}

/**
* Throws {@code UnsupportedOperationException}.
*
* @throws UnsupportedOperationException always
*
* @deprecated This method was originally specified to suspend a thread.
* It was inherently deadlock-prone. If the target thread held a lock on
* a monitor protecting a critical system resource when it was suspended,
* no thread could access the resource until the target thread was resumed.
* If the thread intending to resume the target thread attempted to lock
* the monitor prior to calling {@code resume}, deadlock would result.
* Such deadlocks typically manifested themselves as "frozen" processes.
* For more information, see
* <a href="{@docRoot}/java.base/java/lang/doc-files/threadPrimitiveDeprecation.html">Why
* are Thread.stop, Thread.suspend and Thread.resume Deprecated?</a>.
*/
@Deprecated(since="1.2", forRemoval=true)
public final void suspend() {
throw new UnsupportedOperationException();
}

/**
* Throws {@code UnsupportedOperationException}.
*
* @throws UnsupportedOperationException always
*
* @deprecated This method was originally specified to resume a thread
* suspended with {@link #suspend()}. Suspending a thread was
* inherently deadlock-prone.
* For more information, see
* <a href="{@docRoot}/java.base/java/lang/doc-files/threadPrimitiveDeprecation.html">Why
* are Thread.stop, Thread.suspend and Thread.resume Deprecated?</a>.
*/
@Deprecated(since="1.2", forRemoval=true)
public final void resume() {
throw new UnsupportedOperationException();
}

/**
* Changes the priority of this thread.
*
Expand Down
35 changes: 1 addition & 34 deletions src/java.base/share/classes/java/lang/ThreadGroup.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2024, 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
Expand Down Expand Up @@ -555,17 +555,6 @@ private int enumerate(ThreadGroup[] list, int i, boolean recurse) {
return i;
}

/**
* Throws {@code UnsupportedOperationException}.
*
* @deprecated This method was originally specified to stop all threads in
* the thread group. It was inherently unsafe.
*/
@Deprecated(since="1.2", forRemoval=true)
public final void stop() {
throw new UnsupportedOperationException();
}

/**
* Interrupts all {@linkplain Thread#isAlive() live} platform threads in
* this thread group and its subgroups.
Expand All @@ -588,28 +577,6 @@ public final void interrupt() {
}
}

/**
* Throws {@code UnsupportedOperationException}.
*
* @deprecated This method was originally specified to suspend all threads
* in the thread group.
*/
@Deprecated(since="1.2", forRemoval=true)
public final void suspend() {
throw new UnsupportedOperationException();
}

/**
* Throws {@code UnsupportedOperationException}.
*
* @deprecated This method was originally specified to resume all threads
* in the thread group.
*/
@Deprecated(since="1.2", forRemoval=true)
public final void resume() {
throw new UnsupportedOperationException();
}

/**
* Does nothing.
*
Expand Down

0 comments on commit c38bdc0

Please sign in to comment.