8154529: some places in the invoke.c that use InvokeRequest* not protected with invokerLock
Reviewed-by: sspitsyn
--- a/jdk/src/jdk.jdwp.agent/share/native/libjdwp/invoker.c Thu Apr 28 00:38:21 2016 -0700
+++ b/jdk/src/jdk.jdwp.agent/share/native/libjdwp/invoker.c Mon Apr 25 15:32:35 2016 +0200
@@ -277,12 +277,14 @@
JDI_ASSERT(thread);
+ debugMonitorEnter(invokerLock);
request = threadControl_getInvokeRequest(thread);
if (request == NULL) {
EXIT_ERROR(AGENT_ERROR_INVALID_THREAD, "getting thread invoke request");
}
request->available = JNI_TRUE;
+ debugMonitorExit(invokerLock);
}
jvmtiError
@@ -739,29 +741,20 @@
}
jboolean
-invoker_isPending(jthread thread)
+invoker_isEnabled(jthread thread)
{
InvokeRequest *request;
+ jboolean isEnabled;
JDI_ASSERT(thread);
+ debugMonitorEnter(invokerLock);
request = threadControl_getInvokeRequest(thread);
if (request == NULL) {
EXIT_ERROR(AGENT_ERROR_INVALID_THREAD, "getting thread invoke request");
}
- return request->pending;
-}
-
-jboolean
-invoker_isEnabled(jthread thread)
-{
- InvokeRequest *request;
-
- JDI_ASSERT(thread);
- request = threadControl_getInvokeRequest(thread);
- if (request == NULL) {
- EXIT_ERROR(AGENT_ERROR_INVALID_THREAD, "getting thread invoke request");
- }
- return request->available;
+ isEnabled = request->available;
+ debugMonitorExit(invokerLock);
+ return isEnabled;
}
void
--- a/jdk/src/jdk.jdwp.agent/share/native/libjdwp/invoker.h Thu Apr 28 00:38:21 2016 -0700
+++ b/jdk/src/jdk.jdwp.agent/share/native/libjdwp/invoker.h Mon Apr 25 15:32:35 2016 +0200
@@ -67,7 +67,6 @@
jboolean invoker_doInvoke(jthread thread);
void invoker_completeInvokeRequest(jthread thread);
-jboolean invoker_isPending(jthread thread);
jboolean invoker_isEnabled(jthread thread);
void invoker_detach(InvokeRequest *request);