8255696: JDWP debug agent's canSuspendResumeThreadLists() should be removed

Reviewed-by: amenkov, sspitsyn
This commit is contained in:
Chris Plummer 2020-11-02 20:23:44 +00:00
parent a250716ad2
commit ceba2f8503
3 changed files with 4 additions and 33 deletions
src/jdk.jdwp.agent/share/native/libjdwp

@ -1516,22 +1516,9 @@ threadControl_suspendAll(void)
error = AGENT_ERROR_OUT_OF_MEMORY;
goto err;
}
if (canSuspendResumeThreadLists()) {
error = commonSuspendList(env, count, threads);
if (error != JVMTI_ERROR_NONE) {
goto err;
}
} else {
int i;
for (i = 0; i < count; i++) {
error = commonSuspend(env, threads[i], JNI_FALSE);
if (error != JVMTI_ERROR_NONE) {
goto err;
}
}
error = commonSuspendList(env, count, threads);
if (error != JVMTI_ERROR_NONE) {
goto err;
}
/*
@ -1590,12 +1577,7 @@ threadControl_resumeAll(void)
* no need to get the whole thread list from JVMTI (unlike
* suspendAll).
*/
if (canSuspendResumeThreadLists()) {
error = commonResumeList(env);
} else {
error = enumerateOverThreadList(env, &runningThreads,
resumeHelper, NULL);
}
error = commonResumeList(env);
if ((error == JVMTI_ERROR_NONE) && (otherThreads.first != NULL)) {
error = enumerateOverThreadList(env, &otherThreads,
resumeHelper, NULL);

@ -962,16 +962,6 @@ jvmtiMicroVersion(void)
>> JVMTI_VERSION_SHIFT_MICRO;
}
jboolean
canSuspendResumeThreadLists(void)
{
jvmtiError error;
jvmtiCapabilities cap;
error = jvmtiGetCapabilities(&cap);
return (error == JVMTI_ERROR_NONE && cap.can_suspend);
}
jvmtiError
getSourceDebugExtension(jclass clazz, char **extensionPtr)
{

@ -337,7 +337,6 @@ jint jvmtiMajorVersion(void);
jint jvmtiMinorVersion(void);
jint jvmtiMicroVersion(void);
jvmtiError getSourceDebugExtension(jclass clazz, char **extensionPtr);
jboolean canSuspendResumeThreadLists(void);
jrawMonitorID debugMonitorCreate(char *name);
void debugMonitorEnter(jrawMonitorID theLock);