mirror of
https://github.com/openjdk/jdk.git
synced 2026-08-03 06:35:31 +00:00
Remove something I missed.
This commit is contained in:
parent
85f6f24fb5
commit
73f23abe55
@ -45,8 +45,6 @@ import jdk.test.lib.dcmd.JMXExecutor;
|
||||
|
||||
import java.util.concurrent.BrokenBarrierException;
|
||||
import java.util.concurrent.CyclicBarrier;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class PrintRawMonitorLockTest {
|
||||
|
||||
@ -117,20 +115,22 @@ public class PrintRawMonitorLockTest {
|
||||
// Wait for threads to get ready.
|
||||
waitForBarrier(readyBarrier);
|
||||
|
||||
OutputAnalyzer output;
|
||||
|
||||
// Execute dcmd in a loop in case the threads haven't deadlocked yet.
|
||||
while (true) {
|
||||
try {
|
||||
Thread.sleep(100);
|
||||
} catch (InterruptedException ie) {
|
||||
}
|
||||
output = executor.execute("Thread.print -l=true");
|
||||
if (output.getOutput().contains("Found 1 deadlock")) {
|
||||
break;
|
||||
OutputAnalyzer output = executor.execute("Thread.print -l=true");
|
||||
if (!output.getOutput().contains("Found 1 deadlock")) {
|
||||
// Execute dcmd in a loop in case the threads haven't deadlocked yet.
|
||||
// Fail after 100 iterations. That's all it should take unless something is wrong.
|
||||
for (int i = 0; i < 100; i++) {
|
||||
try {
|
||||
Thread.sleep(100);
|
||||
} catch (InterruptedException ie) {
|
||||
}
|
||||
// try again, otherwise java thinks it's not initialized.
|
||||
output = executor.execute("Thread.print -l=true");
|
||||
if (output.getOutput().contains("Found 1 deadlock")) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
output.shouldContain("waiting to lock JVM TI raw monitor");
|
||||
}
|
||||
|
||||
|
||||
@ -23,6 +23,7 @@
|
||||
|
||||
#include <string.h>
|
||||
#include "jvmti.h"
|
||||
#include "jvmti_common.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
@ -33,13 +34,6 @@ static char threadLockName1[] = "threadLock1";
|
||||
static jrawMonitorID threadLock2 = nullptr;
|
||||
static char threadLockName2[] = "threadLock2";
|
||||
|
||||
#define LOG(...) \
|
||||
do { \
|
||||
printf(__VA_ARGS__); \
|
||||
printf("\n"); \
|
||||
fflush(stdout); \
|
||||
} while (0)
|
||||
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_PrintRawMonitorLockTest_createRawMonitors(JNIEnv *jni, jclass cls) {
|
||||
if (jvmti->CreateRawMonitor(threadLockName1, &threadLock1) != JNI_OK) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user