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 31bcd9f commit 7844379
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/java.base/share/classes/java/util/Timer.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

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

Expand Down Expand Up @@ -542,6 +542,7 @@ class TimerThread extends Thread {
private TaskQueue queue;

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

Expand Down

0 comments on commit 7844379

Please sign in to comment.