Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Temporarily restore Thread/ThreadGroup suspend/resume/stop" #16

Merged
merged 1 commit into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
33 changes: 0 additions & 33 deletions src/java.base/share/classes/java/lang/ThreadGroup.java
Original file line number Diff line number Diff line change
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