8231602: Deprecate Thread.suspend/resume for removal
Reviewed-by: mchung, dholmes, chegar
This commit is contained in:
parent
06d37a2754
commit
e69b4d261d
@ -1075,7 +1075,7 @@ class Thread implements Runnable {
|
|||||||
* <a href="{@docRoot}/java.base/java/lang/doc-files/threadPrimitiveDeprecation.html">Why
|
* <a href="{@docRoot}/java.base/java/lang/doc-files/threadPrimitiveDeprecation.html">Why
|
||||||
* are Thread.stop, Thread.suspend and Thread.resume Deprecated?</a>.
|
* are Thread.stop, Thread.suspend and Thread.resume Deprecated?</a>.
|
||||||
*/
|
*/
|
||||||
@Deprecated(since="1.2")
|
@Deprecated(since="1.2", forRemoval=true)
|
||||||
public final void suspend() {
|
public final void suspend() {
|
||||||
checkAccess();
|
checkAccess();
|
||||||
suspend0();
|
suspend0();
|
||||||
@ -1101,7 +1101,7 @@ class Thread implements Runnable {
|
|||||||
* <a href="{@docRoot}/java.base/java/lang/doc-files/threadPrimitiveDeprecation.html">Why
|
* <a href="{@docRoot}/java.base/java/lang/doc-files/threadPrimitiveDeprecation.html">Why
|
||||||
* are Thread.stop, Thread.suspend and Thread.resume Deprecated?</a>.
|
* are Thread.stop, Thread.suspend and Thread.resume Deprecated?</a>.
|
||||||
*/
|
*/
|
||||||
@Deprecated(since="1.2")
|
@Deprecated(since="1.2", forRemoval=true)
|
||||||
public final void resume() {
|
public final void resume() {
|
||||||
checkAccess();
|
checkAccess();
|
||||||
resume0();
|
resume0();
|
||||||
|
@ -666,8 +666,8 @@ class ThreadGroup implements Thread.UncaughtExceptionHandler {
|
|||||||
* @deprecated This method is inherently deadlock-prone. See
|
* @deprecated This method is inherently deadlock-prone. See
|
||||||
* {@link Thread#suspend} for details.
|
* {@link Thread#suspend} for details.
|
||||||
*/
|
*/
|
||||||
@Deprecated(since="1.2")
|
@Deprecated(since="1.2", forRemoval=true)
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("removal")
|
||||||
public final void suspend() {
|
public final void suspend() {
|
||||||
if (stopOrSuspend(true))
|
if (stopOrSuspend(true))
|
||||||
Thread.currentThread().suspend();
|
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
|
* if (and only if) the current thread is found to be in this thread
|
||||||
* group or one of its subgroups.
|
* group or one of its subgroups.
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings({"deprecation", "removal"})
|
||||||
private boolean stopOrSuspend(boolean suspend) {
|
private boolean stopOrSuspend(boolean suspend) {
|
||||||
boolean suicide = false;
|
boolean suicide = false;
|
||||||
Thread us = Thread.currentThread();
|
Thread us = Thread.currentThread();
|
||||||
@ -729,8 +729,8 @@ class ThreadGroup implements Thread.UncaughtExceptionHandler {
|
|||||||
* both of which have been deprecated, as they are inherently
|
* both of which have been deprecated, as they are inherently
|
||||||
* deadlock-prone. See {@link Thread#suspend} for details.
|
* deadlock-prone. See {@link Thread#suspend} for details.
|
||||||
*/
|
*/
|
||||||
@Deprecated(since="1.2")
|
@Deprecated(since="1.2", forRemoval=true)
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("removal")
|
||||||
public final void resume() {
|
public final void resume() {
|
||||||
int ngroupsSnapshot;
|
int ngroupsSnapshot;
|
||||||
ThreadGroup[] groupsSnapshot;
|
ThreadGroup[] groupsSnapshot;
|
||||||
@ -1070,7 +1070,7 @@ class ThreadGroup implements Thread.UncaughtExceptionHandler {
|
|||||||
* which is deprecated. Further, the behavior of this call
|
* which is deprecated. Further, the behavior of this call
|
||||||
* was never specified.
|
* was never specified.
|
||||||
*/
|
*/
|
||||||
@Deprecated(since="1.2")
|
@Deprecated(since="1.2", forRemoval=true)
|
||||||
public boolean allowThreadSuspension(boolean b) {
|
public boolean allowThreadSuspension(boolean b) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user