8231602: Deprecate Thread.suspend/resume for removal

Reviewed-by: mchung, dholmes, chegar
This commit is contained in:
Alan Bateman 2019-10-24 11:07:31 +01:00
parent 06d37a2754
commit e69b4d261d
2 changed files with 8 additions and 8 deletions

View File

@ -1075,7 +1075,7 @@ class Thread implements Runnable {
* <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")
@Deprecated(since="1.2", forRemoval=true)
public final void suspend() {
checkAccess();
suspend0();
@ -1101,7 +1101,7 @@ class Thread implements Runnable {
* <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")
@Deprecated(since="1.2", forRemoval=true)
public final void resume() {
checkAccess();
resume0();

View File

@ -666,8 +666,8 @@ class ThreadGroup implements Thread.UncaughtExceptionHandler {
* @deprecated This method is inherently deadlock-prone. See
* {@link Thread#suspend} for details.
*/
@Deprecated(since="1.2")
@SuppressWarnings("deprecation")
@Deprecated(since="1.2", forRemoval=true)
@SuppressWarnings("removal")
public final void suspend() {
if (stopOrSuspend(true))
Thread.currentThread().suspend();
@ -680,7 +680,7 @@ class ThreadGroup implements Thread.UncaughtExceptionHandler {
* if (and only if) the current thread is found to be in this thread
* group or one of its subgroups.
*/
@SuppressWarnings("deprecation")
@SuppressWarnings({"deprecation", "removal"})
private boolean stopOrSuspend(boolean suspend) {
boolean suicide = false;
Thread us = Thread.currentThread();
@ -729,8 +729,8 @@ class ThreadGroup implements Thread.UncaughtExceptionHandler {
* both of which have been deprecated, as they are inherently
* deadlock-prone. See {@link Thread#suspend} for details.
*/
@Deprecated(since="1.2")
@SuppressWarnings("deprecation")
@Deprecated(since="1.2", forRemoval=true)
@SuppressWarnings("removal")
public final void resume() {
int ngroupsSnapshot;
ThreadGroup[] groupsSnapshot;
@ -1070,7 +1070,7 @@ class ThreadGroup implements Thread.UncaughtExceptionHandler {
* which is deprecated. Further, the behavior of this call
* was never specified.
*/
@Deprecated(since="1.2")
@Deprecated(since="1.2", forRemoval=true)
public boolean allowThreadSuspension(boolean b) {
return true;
}