6988950: JDWP exit error JVMTI_ERROR_WRONG_PHASE(112) (backport from JDK 9)
diff --git a/src/share/back/debugLoop.c b/src/share/back/debugLoop.c
index 388e6ae..f49b53c 100644
--- a/src/share/back/debugLoop.c
+++ b/src/share/back/debugLoop.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, 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
@@ -45,7 +45,7 @@
 
 static volatile struct PacketList *cmdQueue;
 static jrawMonitorID cmdQueueLock;
-static jrawMonitorID resumeLock;
+static jrawMonitorID vmDeathLock;
 static jboolean transportError;
 
 static jboolean
@@ -60,28 +60,17 @@
     }
 }
 
-static jboolean
-resumeCommand(jdwpCmdPacket *cmd)
-{
-    if ( (cmd->cmdSet == JDWP_COMMAND_SET(VirtualMachine)) &&
-         (cmd->cmd == JDWP_COMMAND(VirtualMachine, Resume)) ) {
-        return JNI_TRUE;
-    } else {
-        return JNI_FALSE;
-    }
-}
-
 void
 debugLoop_initialize(void)
 {
-    resumeLock = debugMonitorCreate("JDWP Resume Lock");
+    vmDeathLock = debugMonitorCreate("JDWP VM_DEATH Lock");
 }
 
 void
 debugLoop_sync(void)
 {
-    debugMonitorEnter(resumeLock);
-    debugMonitorExit(resumeLock);
+    debugMonitorEnter(vmDeathLock);
+    debugMonitorExit(vmDeathLock);
 }
 
 /*
@@ -136,14 +125,14 @@
             jboolean replyToSender = JNI_TRUE;
 
             /*
-             * For VirtualMachine.Resume commands we hold the resumeLock
+             * For VirtualMachine commands we hold the vmDeathLock
              * while executing and replying to the command. This ensures
-             * that a Resume after VM_DEATH will be allowed to complete
+             * that a VM command after VM_DEATH will be allowed to complete
              * before the thread posting the VM_DEATH continues VM
              * termination.
              */
-            if (resumeCommand(cmd)) {
-                debugMonitorEnter(resumeLock);
+            if (cmd->cmdSet == JDWP_COMMAND_SET(VirtualMachine)){
+                debugMonitorEnter(vmDeathLock);
             }
 
             /* Initialize the input and output streams */
@@ -181,10 +170,10 @@
             }
 
             /*
-             * Release the resumeLock as the reply has been posted.
+             * Release the vmDeathLock as the reply has been posted.
              */
-            if (resumeCommand(cmd)) {
-                debugMonitorExit(resumeLock);
+            if (cmd->cmdSet == JDWP_COMMAND_SET(VirtualMachine)){
+               debugMonitorExit(vmDeathLock);
             }
 
             inStream_destroy(&in);