@@ -1221,7 +1221,7 @@ SH_CacheMap::readCache(J9VMThread* currentThread, SH_CompositeCacheImpl* cache,
1221
1221
1222
1222
/* THREADING: MUST be protected by cache write mutex - therefore single-threaded within this JVM */
1223
1223
IDATA
1224
- SH_CacheMap::checkForCrash (J9VMThread* currentThread, bool hasClassSegmentMutex)
1224
+ SH_CacheMap::checkForCrash (J9VMThread* currentThread, bool hasClassSegmentMutex, bool canUnlockCache )
1225
1225
{
1226
1226
IDATA rc = 0 ;
1227
1227
PORT_ACCESS_FROM_PORT (_portlib);
@@ -1235,7 +1235,7 @@ SH_CacheMap::checkForCrash(J9VMThread* currentThread, bool hasClassSegmentMutex)
1235
1235
if (resetAllManagers (currentThread) != 0 ) {
1236
1236
return -1 ;
1237
1237
}
1238
- _cc->reset (currentThread);
1238
+ _cc->reset (currentThread, canUnlockCache );
1239
1239
rc = refreshHashtables (currentThread, hasClassSegmentMutex);
1240
1240
}
1241
1241
return rc;
@@ -1567,7 +1567,7 @@ SH_CacheMap::addClasspathToCache(J9VMThread* currentThread, ClasspathItem* obj)
1567
1567
* @return the number of items read, or -1 on error
1568
1568
*/
1569
1569
IDATA
1570
- SH_CacheMap::runEntryPointChecks (J9VMThread* currentThread, void * address, const char ** p_subcstr)
1570
+ SH_CacheMap::runEntryPointChecks (J9VMThread* currentThread, void * address, const char ** p_subcstr, bool canUnlockCache )
1571
1571
{
1572
1572
bool hasClassSegmentMutex = false ;
1573
1573
IDATA itemsAdded;
@@ -1600,7 +1600,7 @@ SH_CacheMap::runEntryPointChecks(J9VMThread* currentThread, void* address, const
1600
1600
if (!_ccHead->isRunningReadOnly ()) {
1601
1601
if (_ccHead->hasWriteMutex (currentThread)) {
1602
1602
/* Can only call this function if we have the write mutex */
1603
- rc = checkForCrash (currentThread, hasClassSegmentMutex);
1603
+ rc = checkForCrash (currentThread, hasClassSegmentMutex, canUnlockCache );
1604
1604
if (rc < 0 ) {
1605
1605
Trc_SHR_CM_runEntryPointChecks_Exit_Failed4 (currentThread);
1606
1606
return rc;
@@ -2975,7 +2975,7 @@ SH_CacheMap::updateROMClassResource(J9VMThread* currentThread, const void* addre
2975
2975
}
2976
2976
hasWriteMutex = true ;
2977
2977
2978
- if (runEntryPointChecks (currentThread, (void *)addressInCache, p_subcstr) == -1 ) {
2978
+ if (runEntryPointChecks (currentThread, (void *)addressInCache, p_subcstr, false ) == -1 ) {
2979
2979
Trc_SHR_CM_updateROMClassResource_Exit3 (currentThread);
2980
2980
result = J9SHR_RESOURCE_STORE_ERROR;
2981
2981
break ;
@@ -4410,7 +4410,7 @@ SH_CacheMap::markStale(J9VMThread* currentThread, ClasspathEntryItem* cpei, bool
4410
4410
currentThread->omrVMThread ->vmState = J9VMSTATE_SHAREDCLASS_MARKSTALE;
4411
4411
while (retryCount < MARK_STALE_RETRY_TIMES) {
4412
4412
if (hasWriteMutex || (_ccHead->enterWriteMutex (currentThread, true ,fnName)==0 )) { /* true = lockCache */
4413
- if (runEntryPointChecks (currentThread, NULL , NULL ) == -1 ) {
4413
+ if (runEntryPointChecks (currentThread, NULL , NULL , false ) == -1 ) {
4414
4414
if (!hasWriteMutex) {
4415
4415
_ccHead->exitWriteMutex (currentThread, fnName); /* Will unlock cache */
4416
4416
}
0 commit comments