Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 79446 Details for
Bug 190796
[Martini/JPI] Thread Start event simulation during VM_Init is not JNI safe
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch for 4.4. source stream. Fixed in 4.5
patch_190796.txt (text/plain), 5.45 KB, created by
Asaf Yaffe
on 2007-09-30 10:12:23 EDT
(
hide
)
Description:
Patch for 4.4. source stream. Fixed in 4.5
Filename:
MIME Type:
Creator:
Asaf Yaffe
Created:
2007-09-30 10:12:23 EDT
Size:
5.45 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.tptp.platform.jvmti.runtime >Index: src-native/src/Martini/Infrastructure/JPI/ThreadInfoManager.cpp >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.jvmti.runtime/src-native/src/Martini/Infrastructure/JPI/ThreadInfoManager.cpp,v >retrieving revision 1.12 >diff -u -r1.12 ThreadInfoManager.cpp >--- src-native/src/Martini/Infrastructure/JPI/ThreadInfoManager.cpp 2 May 2007 09:55:12 -0000 1.12 >+++ src-native/src/Martini/Infrastructure/JPI/ThreadInfoManager.cpp 30 Sep 2007 14:10:45 -0000 >@@ -32,7 +32,7 @@ > > CThreadInfoManager::CThreadInfoManager() > : m_ptlsThreadInfo(NULL), m_pcsThreadManager(NULL), m_pEventManager(NULL), >- m_pThreadIdAllocator(NULL), m_pVMInterfafe(NULL) >+ m_pThreadIdAllocator(NULL), m_pVMInterface(NULL) > { > > } >@@ -54,7 +54,7 @@ > TResult CThreadInfoManager::Init(CEventManager *pEventManager) > { > m_pEventManager = pEventManager; >- m_pVMInterfafe = CJpiGlobals::Instance()->pJvmInterface; >+ m_pVMInterface = CJpiGlobals::Instance()->pJvmInterface; > > // Initialize Critical Section > if (!m_pcsThreadManager) >@@ -112,7 +112,15 @@ > } > else > { >- threadWeakGlobalRef = const_cast<JNIEnv*>(pJniEnv)->NewWeakGlobalRef(threadRef); >+ JNIEnv* pCurrentJniEnv; >+ TResult res = m_pVMInterface->GetJNIEnv(&pCurrentJniEnv); >+ if (MRTE_FAILED(res)) >+ { >+ MARTINI_INFORMATIVE("CThreadInfoManager", 0, false, >+ "failed to obtain JNI environment of the calling thread"); >+ return MRTE_ERROR_FAIL; >+ } >+ threadWeakGlobalRef = pCurrentJniEnv->NewWeakGlobalRef(threadRef); > if (NULL == threadWeakGlobalRef) > { > MARTINI_ERROR("CThreadInfoManager", >@@ -251,7 +259,7 @@ > memset(&threadInfo, 0, sizeof(SThreadInfo)); > if (thread != NULL) > { >- m_pVMInterfafe->GetThreadInfo(&threadInfo, thread); >+ m_pVMInterface->GetThreadInfo(&threadInfo, thread); > } > iRes = ThreadStart(&threadId, pJniEnv, thread, true, threadInfo.szName, > threadInfo.szGroupName, threadInfo.szParentGroupName); >@@ -356,7 +364,7 @@ > if (NULL != pTlsThreadInfo && NULL == pTlsThreadInfo->threadInfo.szName) > { > SThreadInfo threadInfo; >- TResult iRes = m_pVMInterfafe->GetThreadInfo(&threadInfo, >+ TResult iRes = m_pVMInterface->GetThreadInfo(&threadInfo, > pTlsThreadInfo->wgrThread); > if (MRTE_SUCCEEDED(iRes)) > { >@@ -443,7 +451,7 @@ > if (STlsThreadInfo::ALIVE == pTlsThreadInfo->threadState > && STlsThreadInfo::JAVA == pTlsThreadInfo->threadType) > { >- TResult iRes = m_pVMInterfafe->SuspendThread(pTlsThreadInfo->wgrThread); >+ TResult iRes = m_pVMInterface->SuspendThread(pTlsThreadInfo->wgrThread); > if (MRTE_SUCCEEDED(iRes)) > { > pTlsThreadInfo->threadState = STlsThreadInfo::SUSPENDED; >@@ -481,7 +489,7 @@ > { > if (STlsThreadInfo::SUSPENDED == pTlsThreadInfo->threadState) > { >- TResult iRes = m_pVMInterfafe->ResumeThread(pTlsThreadInfo->wgrThread); >+ TResult iRes = m_pVMInterface->ResumeThread(pTlsThreadInfo->wgrThread); > if (MRTE_SUCCEEDED(iRes)) > { > pTlsThreadInfo->threadState = STlsThreadInfo::ALIVE; >@@ -553,7 +561,7 @@ > { > TThreadInfoVector threadInfoVec; > JNIEnv *pJniEnv; >- TResult res = m_pVMInterfafe->GetJNIEnv(&pJniEnv); >+ TResult res = m_pVMInterface->GetJNIEnv(&pJniEnv); > if (MRTE_FAILED(res)) > { > return 0; >@@ -590,7 +598,7 @@ > } > thread = pTlsInfo->wgrThread; > } >- return m_pVMInterfafe->GetStackTrace(pFrameBuffer, pFrameCount, thread, 0, maxFrameCount); >+ return m_pVMInterface->GetStackTrace(pFrameBuffer, pFrameCount, thread, 0, maxFrameCount); > } > > TResult CThreadInfoManager::GetState(EThreadState *pState, TId threadId) >@@ -608,13 +616,13 @@ > thread = pTlsInfo->wgrThread; > } > jint jvmState = 0; >- TResult res = m_pVMInterfafe->GetThreadState(&jvmState, thread); >+ TResult res = m_pVMInterface->GetThreadState(&jvmState, thread); > if (MRTE_FAILED(res)) > { > return res; > } > >- *pState = m_pVMInterfafe->VmThreadStateToMpiThreadState(jvmState); >+ *pState = m_pVMInterface->VmThreadStateToMpiThreadState(jvmState); > > return MRTE_RESULT_OK; > } >Index: src-native/src/Martini/Infrastructure/JPI/ThreadInfoManager.h >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.jvmti.runtime/src-native/src/Martini/Infrastructure/JPI/ThreadInfoManager.h,v >retrieving revision 1.11 >diff -u -r1.11 ThreadInfoManager.h >--- src-native/src/Martini/Infrastructure/JPI/ThreadInfoManager.h 2 May 2007 09:55:12 -0000 1.11 >+++ src-native/src/Martini/Infrastructure/JPI/ThreadInfoManager.h 30 Sep 2007 14:10:45 -0000 >@@ -353,7 +353,7 @@ > CEventManager *m_pEventManager; > > // Pointer to the VM interface >- IJVM *m_pVMInterfafe; >+ IJVM *m_pVMInterface; > > // Critical section to guard Thread Manager's internal databases > OSA::IThreadSync *m_pcsThreadManager;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 190796
: 79446