6545967: sp05t003 failed ResumeThread() due to THREAD_NOT_SUSPENDED
Reviewed-by: cjplummer, sspitsyn
This commit is contained in:
parent
07012c9753
commit
dfe4aabde4
@ -85,21 +85,24 @@ public class hs203t003 extends RedefineAgent {
|
||||
// check if we can can pop the thread.
|
||||
// we can not do redefine/pop frame on run method.
|
||||
while (!MyThread.resume.get());
|
||||
Thread.sleep(10000);
|
||||
// sleep for some few secs to get redefined.
|
||||
popThreadFrame(mt);
|
||||
// pop the frame.
|
||||
resumeThread(mt);
|
||||
// resume the thread.
|
||||
while (!isRedefined()) {
|
||||
if (!agentStatus()) {
|
||||
System.out.println("Failed to redefine class");
|
||||
return passed;
|
||||
}
|
||||
Thread.sleep(100);
|
||||
}
|
||||
popThreadFrame(mt); // pop the frame.
|
||||
resumeThread(mt); // resume the thread.
|
||||
mt.join();
|
||||
// wait till the other thread completes its execution.
|
||||
System.out.println(" Thread state after poping / redefining = "+mt.threadState);
|
||||
System.out.println("Thread state after popping/redefining = "
|
||||
+ mt.threadState);
|
||||
} catch(Exception ie) {
|
||||
ie.printStackTrace();
|
||||
}
|
||||
if ( ( mt.threadState < 1000 ) &&
|
||||
( redefineAttempted() && isRedefined()) &&
|
||||
agentStatus() ) {
|
||||
if ((mt.threadState < 1000) && agentStatus()) {
|
||||
passed = true;
|
||||
}
|
||||
return passed;
|
||||
|
@ -383,7 +383,6 @@ callbackThreadStart(jvmtiEnv* jvmti, JNIEnv* jni, jthread thread) {
|
||||
for (i = 0; i < THREADS_COUNT; i++) {
|
||||
if (NSK_CPP_STUB3(IsSameObject, jni, threadsList[i], thread)) {
|
||||
NSK_DISPLAY0("SUCCESS: expected THREAD_START event\n");
|
||||
eventsStart++;
|
||||
|
||||
/* suspend thread */
|
||||
NSK_DISPLAY3(" suspend starting thread #%d (%s): %p\n",
|
||||
@ -394,6 +393,7 @@ callbackThreadStart(jvmtiEnv* jvmti, JNIEnv* jni, jthread thread) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
return;
|
||||
}
|
||||
eventsStart++;
|
||||
|
||||
break;
|
||||
}
|
||||
@ -418,7 +418,6 @@ callbackThreadEnd(jvmtiEnv* jvmti, JNIEnv* jni, jthread thread) {
|
||||
for (i = 0; i < THREADS_COUNT; i++) {
|
||||
if (NSK_CPP_STUB3(IsSameObject, jni, threadsList[i], thread)) {
|
||||
NSK_DISPLAY0("SUCCESS: expected THREAD_END event\n");
|
||||
eventsEnd++;
|
||||
|
||||
/* suspend thread */
|
||||
NSK_DISPLAY3(" suspend finishing thread #%d (%s): %p\n",
|
||||
@ -429,6 +428,7 @@ callbackThreadEnd(jvmtiEnv* jvmti, JNIEnv* jni, jthread thread) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
return;
|
||||
}
|
||||
eventsEnd++;
|
||||
|
||||
break;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user