Skip to content

Commit

Permalink
Set a default thread name for java.util.TimerThread
Browse files Browse the repository at this point in the history
Issue eclipse-openj9/openj9#11930

The name isn't set in the TimerThread constructor, it calls
Thread.newName() which consumes the "Thread-0" name. This causes the
test to fail because it expects this name. This could have an impact on
/ confuse users which expect consistent thread names. Depending on the
timing of the Attach API AttachHandler / FilelockTimer creation, an
application can get different default thread names from run to run.

Backport of ibmruntimes/openj9-openjdk-jdk#640

Signed-off-by: Peter Shipton <Peter_Shipton@ca.ibm.com>
  • Loading branch information
pshipton committed Aug 9, 2023
1 parent f67855f commit 6449f1d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions jdk/src/share/classes/java/util/Timer.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
* questions.
*/

/*
* ===========================================================================
* (c) Copyright IBM Corp. 2023, 2023 All Rights Reserved
* ===========================================================================
*/

package java.util;
import java.util.Date;
import java.util.concurrent.atomic.AtomicInteger;
Expand Down Expand Up @@ -497,6 +503,7 @@ class TimerThread extends Thread {
private TaskQueue queue;

TimerThread(TaskQueue queue) {
super("java.util.TimerThread");
this.queue = queue;
}

Expand Down

0 comments on commit 6449f1d

Please sign in to comment.