src/share/classes/java/lang/ThreadGroup.java
Print this page
@@ -668,10 +668,11 @@
* @since JDK1.0
* @deprecated This method is inherently deadlock-prone. See
* {@link Thread#suspend} for details.
*/
@Deprecated
+ @SuppressWarnings("deprecation")
public final void suspend() {
if (stopOrSuspend(true))
Thread.currentThread().suspend();
}
@@ -680,10 +681,11 @@
* boolean argument) all of the threads in this thread group and its
* subgroups, except the current thread. This method returns true
* if (and only if) the current thread is found to be in this thread
* group or one of its subgroups.
*/
+ @SuppressWarnings("deprecation")
private boolean stopOrSuspend(boolean suspend) {
boolean suicide = false;
Thread us = Thread.currentThread();
int ngroupsSnapshot;
ThreadGroup[] groupsSnapshot = null;
@@ -729,10 +731,11 @@
* <tt>Thread.suspend</tt> and <tt>ThreadGroup.suspend</tt>,
* both of which have been deprecated, as they are inherently
* deadlock-prone. See {@link Thread#suspend} for details.
*/
@Deprecated
+ @SuppressWarnings("deprecation")
public final void resume() {
int ngroupsSnapshot;
ThreadGroup[] groupsSnapshot;
synchronized (this) {
checkAccess();