8268285: vmTestbase/nsk/jvmti/GetThreadState/thrstat002 failed with "Wrong thread "thr1" (...) state after SuspendThread"

Reviewed-by: lmesnik, amenkov, dholmes
This commit is contained in:
Serguei Spitsyn 2021-06-10 06:03:19 +00:00
parent ece3ae3cc4
commit dd1cbadc82
2 changed files with 7 additions and 3 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004, 2021, 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
@ -158,8 +158,11 @@ class thrstat002a extends Thread {
}
System.out.println("thrstat002a.run after blockingMonitor lock");
System.out.println("thrstat002a.run before runningBarrier unlock");
thrstat002.runningBarrier.unlock();
System.out.println("thrstat002a.run after runningBarrier unlock");
// Don't do println's from this point until we have exited the loop,
// else we can suspend in the println in an unexpected state.
int i = 0;
int n = 1000;
while (flag) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004, 2021, 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
@ -355,6 +355,7 @@ Java_nsk_jvmti_GetThreadState_thrstat002_checkStatus(JNIEnv *env, jclass cls,
result = STATUS_FAILED;
}
}
fflush(0);
}
JNIEXPORT jint JNICALL