8256364: vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t002 failed with "assert(handle != __null) failed: JNI handle should not be null"
Reviewed-by: cjplummer, sspitsyn
This commit is contained in:
parent
f1d6e8dbb6
commit
2a1e9be6c2
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2020, 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
|
||||
@ -107,6 +107,7 @@ public class cm01t002 extends DebugeeClass {
|
||||
class cm01t002Thread extends Thread {
|
||||
public Object startingMonitor = new Object();
|
||||
private Object waitingMonitor = new Object();
|
||||
private boolean timeToDie = false;
|
||||
|
||||
public cm01t002Thread(String name) {
|
||||
super(name);
|
||||
@ -128,7 +129,14 @@ class cm01t002Thread extends Thread {
|
||||
|
||||
// wait on monitor
|
||||
try {
|
||||
waitingMonitor.wait(cm01t002.timeout);
|
||||
long maxTime = System.currentTimeMillis() + cm01t002.timeout;
|
||||
while (!timeToDie) {
|
||||
long timeout = maxTime - System.currentTimeMillis();
|
||||
if (timeout <= 0) {
|
||||
break;
|
||||
}
|
||||
waitingMonitor.wait(timeout);
|
||||
}
|
||||
} catch (InterruptedException ignore) {
|
||||
// just finish
|
||||
}
|
||||
@ -144,6 +152,7 @@ class cm01t002Thread extends Thread {
|
||||
|
||||
public void letFinish() {
|
||||
synchronized (waitingMonitor) {
|
||||
timeToDie = true;
|
||||
waitingMonitor.notify();
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2020, 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
|
||||
@ -99,6 +99,11 @@ static int prepare() {
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threads)))
|
||||
return NSK_FALSE;
|
||||
|
||||
if (thread == NULL) {
|
||||
nsk_lcomplain(__FILE__, __LINE__, "tested thread not found\n");
|
||||
return NSK_FALSE;
|
||||
}
|
||||
|
||||
/* get tested thread class */
|
||||
if (!NSK_JNI_VERIFY(jni, (klass = jni->GetObjectClass(thread)) != NULL))
|
||||
return NSK_FALSE;
|
||||
|
Loading…
x
Reference in New Issue
Block a user