Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2026, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand All @@ -22,8 +22,9 @@
*/

package nsk.stress.jni;
import jdk.test.lib.thread.ThreadWrapper;

class GarbageGenerator extends Thread {
class GarbageGenerator extends ThreadWrapper {
class Garbage {
Garbage() {
this(1024);
Expand Down
12 changes: 8 additions & 4 deletions test/hotspot/jtreg/vmTestbase/nsk/stress/jni/jnistress001.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2026, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -61,8 +61,9 @@
import nsk.share.Consts;
import nsk.share.Debug;
import nsk.share.test.StressOptions;
import jdk.test.lib.thread.ThreadWrapper;

public class jnistress001 extends Thread {
public class jnistress001 extends ThreadWrapper {

/* Maximum number of iterations. Ignored if <= 0L */
static long numIteration = 0L;
Expand Down Expand Up @@ -256,8 +257,11 @@ public static void main(String[] argv) {
garb = new GarbageGenerator[nGarb];
for (i = 0; i < nJNI; i++)
jniter[i] = new JNIter001(sync);
Thread[] jniterThreads = new Thread[nJNI];
for (i = 0; i < nJNI; i++)
jniterThreads[i] = jniter[i].getThread();
for (i = 0; i < nInter; i++) {
irupt[i] = new Interrupter(jniter, sync);
irupt[i] = new Interrupter(jniterThreads, sync);
irupt[i].setInterval(iruptInterval);
}
for (i = 0; i < nGarb; i++) {
Expand Down Expand Up @@ -372,7 +376,7 @@ public boolean finished() {
final private static boolean DEBUG = false;
}

class JNIter001 extends Thread {
class JNIter001 extends ThreadWrapper {

// The native method for testing JNI UTF-8 calls
public native String jnistress(String threadName, int nstr, int printPeriod);
Expand Down
12 changes: 8 additions & 4 deletions test/hotspot/jtreg/vmTestbase/nsk/stress/jni/jnistress002.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2026, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -60,12 +60,13 @@
import nsk.share.Consts;
import nsk.share.Debug;
import nsk.share.test.StressOptions;
import jdk.test.lib.thread.ThreadWrapper;
import jdk.test.lib.Utils;

import java.lang.reflect.Field;
import java.util.Random;

public class jnistress002 extends Thread {
public class jnistress002 extends ThreadWrapper {

/* Maximum number of iterations. Ignored if <= 0L */
static long numIteration = 0L;
Expand Down Expand Up @@ -246,8 +247,11 @@ public static void main(String[] argv) {
garb = new GarbageGenerator[nGarb];
for (i = 0; i < nJNI; i++)
jniter[i] = new JNIter002(sync);
Thread[] jniterThreads = new Thread[nJNI];
for (i = 0; i < nJNI; i++)
jniterThreads[i] = jniter[i].getThread();
for (i = 0; i < nInter; i++) {
irupt[i] = new Interrupter(jniter, sync);
irupt[i] = new Interrupter(jniterThreads, sync);
irupt[i].setInterval(iruptInterval);
}
for (i = 0; i < nGarb; i++) {
Expand Down Expand Up @@ -423,7 +427,7 @@ public boolean equals(Object o) {
}
}

class JNIter002 extends Thread {
class JNIter002 extends ThreadWrapper {

// The native method for testing JNI Object's calls
public native objectsJNI[] jniobjects(String s, int i, long l,
Expand Down
12 changes: 8 additions & 4 deletions test/hotspot/jtreg/vmTestbase/nsk/stress/jni/jnistress003.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2026, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -60,10 +60,11 @@
import nsk.share.Consts;
import nsk.share.Debug;
import nsk.share.test.StressOptions;
import jdk.test.lib.thread.ThreadWrapper;

import java.lang.reflect.Array;

public class jnistress003 extends Thread {
public class jnistress003 extends ThreadWrapper {

/* Maximum number of iterations. Ignored if <= 0L */
static long numIteration = 0L;
Expand Down Expand Up @@ -257,8 +258,11 @@ public static void main(String[] argv) {
garb = new GarbageGenerator[nGarb];
for (i = 0; i < nJNI; i++)
jniter[i] = new JNIter003(sync);
Thread[] jniterThreads = new Thread[nJNI];
for (i = 0; i < nJNI; i++)
jniterThreads[i] = jniter[i].getThread();
for (i = 0; i < nInter; i++) {
irupt[i] = new Interrupter(jniter, sync);
irupt[i] = new Interrupter(jniterThreads, sync);
irupt[i].setInterval(iruptInterval);
}
for (i = 0; i < nGarb; i++) {
Expand Down Expand Up @@ -379,7 +383,7 @@ public boolean finished() {
final private static boolean DEBUG = false;
}

class JNIter003 extends Thread {
class JNIter003 extends ThreadWrapper {

// The native methods for testing JNI Arrays calls

Expand Down
12 changes: 8 additions & 4 deletions test/hotspot/jtreg/vmTestbase/nsk/stress/jni/jnistress004.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2026, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -60,8 +60,9 @@
import nsk.share.Consts;
import nsk.share.Debug;
import nsk.share.test.StressOptions;
import jdk.test.lib.thread.ThreadWrapper;

public class jnistress004 extends Thread {
public class jnistress004 extends ThreadWrapper {

/* Maximum number of iterations. Ignored if <= 0L */
static long numIteration = 2L;
Expand Down Expand Up @@ -243,8 +244,11 @@ public static void main(String[] argv) {
garb = new GarbageGenerator[nGarb];
for (i = 0; i < nJNI; i++)
jniter[i] = new JNIter004(sync);
Thread[] jniterThreads = new Thread[nJNI];
for (i = 0; i < nJNI; i++)
jniterThreads[i] = jniter[i].getThread();
for (i = 0; i < nInter; i++) {
irupt[i] = new Interrupter(jniter, sync);
irupt[i] = new Interrupter(jniterThreads, sync);
irupt[i].setInterval(iruptInterval);
}
for (i = 0; i < nGarb; i++) {
Expand Down Expand Up @@ -364,7 +368,7 @@ public boolean finished() {
final private static boolean DEBUG = false;
}

class JNIter004 extends Thread {
class JNIter004 extends ThreadWrapper {

// The native methods for testing JNI critical calls
public native char[] CheckSum(String str);
Expand Down
12 changes: 8 additions & 4 deletions test/hotspot/jtreg/vmTestbase/nsk/stress/jni/jnistress005.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2026, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -61,8 +61,9 @@
import nsk.share.Consts;
import nsk.share.Debug;
import nsk.share.test.StressOptions;
import jdk.test.lib.thread.ThreadWrapper;

public class jnistress005 extends Thread {
public class jnistress005 extends ThreadWrapper {

/* Maximum number of iterations. Ignored if <= 0L */
static long numIteration = 0L;
Expand Down Expand Up @@ -244,8 +245,11 @@ public static void main(String[] argv) {
garb = new GarbageGenerator[nGarb];
for (i = 0; i < nJNI; i++)
jniter[i] = new JNIter005(sync);
Thread[] jniterThreads = new Thread[nJNI];
for (i = 0; i < nJNI; i++)
jniterThreads[i] = jniter[i].getThread();
for (i = 0; i < nInter; i++) {
irupt[i] = new Interrupter(jniter, sync);
irupt[i] = new Interrupter(jniterThreads, sync);
irupt[i].setInterval(iruptInterval);
}
for (i = 0; i < nGarb; i++) {
Expand Down Expand Up @@ -366,7 +370,7 @@ public boolean finished() {
final private static boolean DEBUG = false;
}

class JNIter005 extends Thread {
class JNIter005 extends ThreadWrapper {

// The native methods for testing JNI exception calls
public native void except(Throwable tobj);
Expand Down
12 changes: 8 additions & 4 deletions test/hotspot/jtreg/vmTestbase/nsk/stress/jni/jnistress006.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2026, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -61,8 +61,9 @@
import nsk.share.Consts;
import nsk.share.Debug;
import nsk.share.test.StressOptions;
import jdk.test.lib.thread.ThreadWrapper;

public class jnistress006 extends Thread {
public class jnistress006 extends ThreadWrapper {

/* Maximum number of iterations. Ignored if <= 0L */
static long numIteration = 0L;
Expand Down Expand Up @@ -245,8 +246,11 @@ public static void main(String[] argv) {
garb = new GarbageGenerator[nGarb];
for (i = 0; i < nJNI; i++)
jniter[i] = new JNIter006(sync);
Thread[] jniterThreads = new Thread[nJNI];
for (i = 0; i < nJNI; i++)
jniterThreads[i] = jniter[i].getThread();
for (i = 0; i < nInter; i++) {
irupt[i] = new Interrupter(jniter, sync);
irupt[i] = new Interrupter(jniterThreads, sync);
irupt[i].setInterval(iruptInterval);
}
for (i = 0; i < nGarb; i++) {
Expand Down Expand Up @@ -366,7 +370,7 @@ public boolean finished() {
final private static boolean DEBUG = false;
}

class JNIter006 extends Thread {
class JNIter006 extends ThreadWrapper {

// The native methods for testing JNI exception calls
public native boolean refs(Object tobj, int jniStringAllocSize);
Expand Down
12 changes: 8 additions & 4 deletions test/hotspot/jtreg/vmTestbase/nsk/stress/jni/jnistress007.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2026, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -61,8 +61,9 @@
import nsk.share.Consts;
import nsk.share.Debug;
import nsk.share.test.StressOptions;
import jdk.test.lib.thread.ThreadWrapper;

public class jnistress007 extends Thread {
public class jnistress007 extends ThreadWrapper {

/* Maximum number of iterations. Ignored if <= 0L */
static long numIteration = 0L;
Expand Down Expand Up @@ -244,8 +245,11 @@ public static void main(String[] argv) {
garb = new GarbageGenerator[nGarb];
for (i = 0; i < nJNI; i++)
jniter[i] = new JNIter007(sync);
Thread[] jniterThreads = new Thread[nJNI];
for (i = 0; i < nJNI; i++)
jniterThreads[i] = jniter[i].getThread();
for (i = 0; i < nInter; i++) {
irupt[i] = new Interrupter(jniter, sync);
irupt[i] = new Interrupter(jniterThreads, sync);
irupt[i].setInterval(iruptInterval);
}
for (i = 0; i < nGarb; i++) {
Expand Down Expand Up @@ -364,7 +368,7 @@ public boolean finished() {
final private static boolean DEBUG = false;
}

class JNIter007 extends Thread {
class JNIter007 extends ThreadWrapper {

// The native methods for testing JNI monitors calls
public native void incCount(String name);
Expand Down