harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From odea...@apache.org
Subject svn commit: r960623 - /harmony/enhanced/java/branches/java6/jdktools/modules/jpda/src/main/native/jdwp/common/agent/core/RequestManager.cpp
Date Mon, 05 Jul 2010 15:22:24 GMT
Author: odeakin
Date: Mon Jul  5 15:22:22 2010
New Revision: 960623

URL: http://svn.apache.org/viewvc?rev=960623&view=rev
Log:
Initialise and delete monitors in constructors/destructors to make sure they are in existence
for the whole life of the RequestManager. Previously it was possible to hit a timing hole
where the monitors had not yet been initialised or had already been deleted and were then
used causing a crash.

Modified:
    harmony/enhanced/java/branches/java6/jdktools/modules/jpda/src/main/native/jdwp/common/agent/core/RequestManager.cpp

Modified: harmony/enhanced/java/branches/java6/jdktools/modules/jpda/src/main/native/jdwp/common/agent/core/RequestManager.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/jdktools/modules/jpda/src/main/native/jdwp/common/agent/core/RequestManager.cpp?rev=960623&r1=960622&r2=960623&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/jdktools/modules/jpda/src/main/native/jdwp/common/agent/core/RequestManager.cpp
(original)
+++ harmony/enhanced/java/branches/java6/jdktools/modules/jpda/src/main/native/jdwp/common/agent/core/RequestManager.cpp
Mon Jul  5 15:22:22 2010
@@ -37,25 +37,15 @@ RequestManager::RequestManager()
     : m_requestIdCount(0)
     , m_requestMonitor(0) 
     , m_combinedEventsMonitor(0) 
-{}
-
-RequestManager::~RequestManager() 
-{}
-
-void RequestManager::Init(JNIEnv* jni)
 {
-    JDWP_TRACE_ENTRY(LOG_RELEASE, (LOG_FUNC_FL, "Init(%p)", jni));
-
     m_requestMonitor = new AgentMonitor("_jdwp_RequestManager_requestMonitor");
     m_combinedEventsMonitor = new AgentMonitor("_jdwp_RequestManager_combinedEventsMonitor");
 	m_exceptionMonitor = new AgentMonitor("_jdwp_RequestManager_exceptionMonitor");
     m_requestIdCount = 1;
 }
 
-void RequestManager::Clean(JNIEnv* jni)
+RequestManager::~RequestManager()
 {
-    JDWP_TRACE_ENTRY(LOG_RELEASE, (LOG_FUNC_FL, "Clean(%p)", jni));
-
     if (m_requestMonitor != 0){
         {
             MonitorAutoLock lock(m_requestMonitor JDWP_FILE_LINE);
@@ -82,6 +72,16 @@ void RequestManager::Clean(JNIEnv* jni)
     }
 }
 
+void RequestManager::Init(JNIEnv* jni)
+{
+    JDWP_TRACE_ENTRY(LOG_RELEASE, (LOG_FUNC_FL, "Init(%p)", jni));
+    }
+
+void RequestManager::Clean(JNIEnv* jni)
+{
+    JDWP_TRACE_ENTRY(LOG_RELEASE, (LOG_FUNC_FL, "Clean(%p)", jni));
+}
+
 void RequestManager::Reset(JNIEnv* jni)
 {
     JDWP_TRACE_ENTRY(LOG_RELEASE, (LOG_FUNC_FL, "Reset(%p)", jni));



Mime
View raw message