Skip to content

Commit

Permalink
Merge pull request #7831 from JasonFengJ9/deprthreadmeth
Browse files Browse the repository at this point in the history
Java 14 Thread/ThreadGroup API Deprecated forRemoval=true
  • Loading branch information
pshipton committed Nov 22, 2019
2 parents 69f78c4 + 3827b1a commit 590de5e
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 17 deletions.
20 changes: 14 additions & 6 deletions jcl/src/java.base/share/classes/java/lang/Thread.java
Expand Up @@ -880,11 +880,15 @@ private synchronized static String newName() {
*
* @deprecated Used with deprecated method Thread.suspend().
*/
/*[IF Sidecar19-SE]*/
/*[IF Java11]*/
/*[IF Java14]*/
@Deprecated(forRemoval=true, since="1.2")
/*[ELSE] Java14 */
@Deprecated(forRemoval=false, since="1.2")
/*[ELSE]*/
/*[ENDIF] Java14 */
/*[ELSE] Java11 */
@Deprecated
/*[ENDIF]*/
/*[ENDIF] Java11 */
public final void resume() {
checkAccess();
synchronized(lock) {
Expand Down Expand Up @@ -1201,11 +1205,15 @@ private final synchronized void stopWithThrowable(Throwable throwable) {
*
* @deprecated May cause deadlocks.
*/
/*[IF Sidecar19-SE]*/
/*[IF Java11]*/
/*[IF Java14]*/
@Deprecated(forRemoval=true, since="1.2")
/*[ELSE] Java14 */
@Deprecated(forRemoval=false, since="1.2")
/*[ELSE]*/
/*[ENDIF] Java14 */
/*[ELSE] Java11 */
@Deprecated
/*[ENDIF]*/
/*[ENDIF] Java11 */
public final void suspend() {
checkAccess();
/*[PR 106321]*/
Expand Down
34 changes: 23 additions & 11 deletions jcl/src/java.base/share/classes/java/lang/ThreadGroup.java
@@ -1,9 +1,9 @@
/*[INCLUDE-IF Sidecar16]*/
/*[INCLUDE-IF Sidecar18-SE]*/

package java.lang;

/*******************************************************************************
* Copyright (c) 1998, 2017 IBM Corp. and others
* Copyright (c) 1998, 2019 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -239,11 +239,15 @@ private void add(ThreadGroup g) throws IllegalThreadStateException {
*
* @deprecated Required deprecated method suspend().
*/
/*[IF Sidecar19-SE]*/
/*[IF Java11]*/
/*[IF Java14]*/
@Deprecated(forRemoval=true, since="1.2")
/*[ELSE] Java14 */
@Deprecated(forRemoval=false, since="1.2")
/*[ELSE]*/
/*[ENDIF] Java14 */
/*[ELSE] Java11 */
@Deprecated
/*[ENDIF]*/
/*[ENDIF] Java11 */
public boolean allowThreadSuspension(boolean b) {
// Does not apply to this VM, no-op
/*[PR 1PR4U1E]*/
Expand Down Expand Up @@ -724,11 +728,15 @@ private void remove(ThreadGroup g) {
*
* @deprecated Requires deprecated method Thread.resume().
*/
/*[IF Sidecar19-SE]*/
/*[IF Java11]*/
/*[IF Java14]*/
@Deprecated(forRemoval=true, since="1.2")
/*[ELSE] Java14 */
@Deprecated(forRemoval=false, since="1.2")
/*[ELSE]*/
/*[ENDIF] Java14 */
/*[ELSE] Java11 */
@Deprecated
/*[ENDIF]*/
/*[ENDIF] Java11 */
public final void resume() {
checkAccess();
synchronized (this.childrenThreadsLock) { // Lock this subpart of the tree as we walk
Expand Down Expand Up @@ -857,11 +865,15 @@ private final boolean stopHelper() {
*
* @deprecated Requires deprecated method Thread.suspend().
*/
/*[IF Sidecar19-SE]*/
/*[IF Java11]*/
/*[IF Java14]*/
@Deprecated(forRemoval=true, since="1.2")
/*[ELSE] Java14 */
@Deprecated(forRemoval=false, since="1.2")
/*[ELSE]*/
/*[ENDIF] Java14 */
/*[ELSE] Java11 */
@Deprecated
/*[ENDIF]*/
/*[ENDIF] Java11 */
public final void suspend() {
if (suspendHelper())
Thread.currentThread().suspend();
Expand Down

0 comments on commit 590de5e

Please sign in to comment.