Skip to content
This repository was archived by the owner on Aug 27, 2022. It is now read-only.
/ lanai Public archive

Commit 6dc6400

Browse files
author
Harold Seigel
committedJul 24, 2020
8250557: Rename vmTestbase/nsk shared timeout handler package to Terminator.java
Rename the class and fix the tests that use it. Reviewed-by: dcubed
1 parent 60bc0e1 commit 6dc6400

File tree

6 files changed

+37
-37
lines changed

6 files changed

+37
-37
lines changed
 

‎test/hotspot/jtreg/vmTestbase/nsk/share/README

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
1+
Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
22
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
33

44
This code is free software; you can redistribute it and/or modify it
@@ -54,7 +54,7 @@ Short description of files:
5454
text processing:
5555
Grep.java, Paragrep.java
5656
timeouts handling:
57-
Harakiri.java, TimeoutHandler.java
57+
Terminator.java, TimeoutHandler.java
5858
tree structures support:
5959
Denotation.java, TreeNodesDenotation.java
6060
RAS mode support:

‎test/hotspot/jtreg/vmTestbase/nsk/share/Harakiri.java ‎test/hotspot/jtreg/vmTestbase/nsk/share/Terminator.java

+23-23
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2001, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -24,32 +24,32 @@
2424
package nsk.share;
2525

2626
/**
27-
* Harakiri is used to terminate a stress test with PASS exit status
27+
* Terminator is used to terminate a stress test with PASS exit status
2828
* before the test is terminated as timed out (and so failed).
2929
*
30-
* <p>Harakiri class holds a thread which sleeps for the given amount
30+
* <p>Terminator class holds a thread which sleeps for the given amount
3131
* of time, and then wakes up and executes <tt>System.exit()</tt>
3232
* with the given exit status. That thread is daemon, so it doesn't
3333
* prevent application from exiting once all its threads finish
34-
* before it's time for harakiri. Appointing harakiri in zero
34+
* before it's time for termination. Appointing terminator in zero
3535
* delay implies immediate <tt>exit()</tt>.
3636
*
37-
* <p>There is a limitation: you may appoint no more than one harakiri
37+
* <p>There is a limitation: you may appoint no more than one terminator
3838
* per application.
3939
*/
40-
public class Harakiri {
40+
public class Terminator {
4141
/**
42-
* Use specific <tt>appoint()</tt> method to appoint harakiri.
42+
* Use specific <tt>appoint()</tt> method to appoint terminator.
4343
*
4444
* @see #appoint(int)
4545
* @see #appoint(int,int)
4646
*/
47-
protected Harakiri() {}
47+
protected Terminator() {}
4848

4949
/**
50-
* One harakiri per application, or <tt>null</tt> (by default).
50+
* One terminator per application, or <tt>null</tt> (by default).
5151
*/
52-
private static Thread harakiri = null;
52+
private static Thread terminator = null;
5353

5454
/**
5555
* <p>Return timeout (or waittime) value munus the margin
@@ -108,11 +108,11 @@ public static int parseAppointment(String args[]) {
108108
}
109109

110110
/**
111-
* Appoint harakiri after the given amount of <tt>minutes</tt>,
111+
* Appoint terminator after the given amount of <tt>minutes</tt>,
112112
* so that exit status would be 95 (to simulate JCK-like PASS
113113
* status).
114114
*
115-
* @throws IllegalStateException If harakiri is already appointed.
115+
* @throws IllegalStateException If terminator is already appointed.
116116
*
117117
* @see #appoint(int,int)
118118
* @see #parseAppointment(String[])
@@ -122,23 +122,23 @@ public static void appoint(int minutes) {
122122
}
123123

124124
/**
125-
* Appoint Harakiri for the given amount of <tt>minutes</tt>,
125+
* Appoint Terminator for the given amount of <tt>minutes</tt>,
126126
* so that the given <tt>status</tt> would be exited when time
127127
* is over.
128128
*
129-
* @throws IllegalStateException If harakiri is already appointed.
129+
* @throws IllegalStateException If terminator is already appointed.
130130
*
131131
* @see #appoint(int)
132132
* @see #parseAppointment(String[])
133133
*/
134134
public static void appoint(int minutes, int status) {
135-
if (harakiri != null)
136-
throw new IllegalStateException("Harakiri is already appointed.");
135+
if (terminator != null)
136+
throw new IllegalStateException("Terminator is already appointed.");
137137

138138
final long timeToExit = System.currentTimeMillis() + 60*1000L*minutes;
139139
final int exitStatus = status;
140140

141-
harakiri = new Thread(Harakiri.class.getName()) {
141+
terminator = new Thread(Terminator.class.getName()) {
142142
public void run() {
143143
long timeToSleep = timeToExit - System.currentTimeMillis();
144144
if (timeToSleep > 0)
@@ -155,21 +155,21 @@ public void run() {
155155
} catch (InterruptedException exception) {
156156
exception.printStackTrace(System.err);
157157
//
158-
// OOPS, the dagger for harakiri looks broken:
158+
// OOPS, the dagger for terminator looks broken:
159159
//
160160
return;
161161
};
162162
//
163163
// OK, lets do it now:
164164
//
165165
System.err.println(
166-
"#\n# Harakiri: prescheduled program termination.\n#");
167-
System.exit(exitStatus); // harakiri to all threads
166+
"#\n# Terminator: prescheduled program termination.\n#");
167+
System.exit(exitStatus); // terminator to all threads
168168
}
169169
};
170170

171-
harakiri.setPriority(Thread.MAX_PRIORITY);
172-
harakiri.setDaemon(true);
173-
harakiri.start();
171+
terminator.setPriority(Thread.MAX_PRIORITY);
172+
terminator.setDaemon(true);
173+
terminator.start();
174174
}
175175
}

‎test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack016.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -57,7 +57,7 @@
5757
package nsk.stress.stack;
5858

5959

60-
import nsk.share.Harakiri;
60+
import nsk.share.Terminator;
6161

6262
import java.io.PrintStream;
6363

@@ -82,7 +82,7 @@ public static int run(String args[], PrintStream out) {
8282
else if (args[i].toLowerCase().equals("-eager"))
8383
eager = true;
8484
if (!eager)
85-
Harakiri.appoint(Harakiri.parseAppointment(args));
85+
Terminator.appoint(Terminator.parseAppointment(args));
8686
stack016.out = out;
8787
stack016 test = new stack016();
8888
return test.doRun();

‎test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack017.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -50,7 +50,7 @@
5050
package nsk.stress.stack;
5151

5252

53-
import nsk.share.Harakiri;
53+
import nsk.share.Terminator;
5454

5555
import java.io.PrintStream;
5656

@@ -73,7 +73,7 @@ public static int run(String args[], PrintStream out) {
7373
else if (args[i].toLowerCase().equals("-eager"))
7474
eager = true;
7575
if (!eager)
76-
Harakiri.appoint(Harakiri.parseAppointment(args));
76+
Terminator.appoint(Terminator.parseAppointment(args));
7777
stack017.out = out;
7878
stack017 test = new stack017();
7979
return test.doRun();

‎test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack018.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -55,7 +55,7 @@
5555
package nsk.stress.stack;
5656

5757

58-
import nsk.share.Harakiri;
58+
import nsk.share.Terminator;
5959

6060
import java.io.PrintStream;
6161
import java.lang.reflect.InvocationTargetException;
@@ -81,7 +81,7 @@ public static int run(String args[], PrintStream out) {
8181
else if (args[i].toLowerCase().equals("-eager"))
8282
eager = true;
8383
if (!eager)
84-
Harakiri.appoint(Harakiri.parseAppointment(args));
84+
Terminator.appoint(Terminator.parseAppointment(args));
8585
stack018.out = out;
8686
stack018 test = new stack018();
8787
return test.doRun();

‎test/hotspot/jtreg/vmTestbase/nsk/stress/stack/stack019.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -48,7 +48,7 @@
4848
package nsk.stress.stack;
4949

5050

51-
import nsk.share.Harakiri;
51+
import nsk.share.Terminator;
5252

5353
import java.io.PrintStream;
5454

@@ -69,7 +69,7 @@ public static int run(String args[], PrintStream out) {
6969
else if (args[i].toLowerCase().equals("-eager"))
7070
eager = true;
7171
if (!eager)
72-
Harakiri.appoint(Harakiri.parseAppointment(args));
72+
Terminator.appoint(Terminator.parseAppointment(args));
7373
//
7474
// Measure recursive depth before stack overflow:
7575
//

0 commit comments

Comments
 (0)
This repository has been archived.